Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/ui.js

Issue 4559243822759936: Issue 431/432 - Remove special handling for the $sitekey option (Closed)
Patch Set: Created Aug. 12, 2014, 9:30 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/filterClasses.js ('K') | « lib/matcher.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -1088,8 +1088,8 @@
let state = (Prefs.enabled ? "active" : "disabled");
if (state == "active")
{
- let location = this.getCurrentLocation(window);
- if (location && Policy.isWhitelisted(location.spec))
+ let {getBrowser} = require("appSupport");
+ if (Policy.isWindowWhitelisted(getBrowser(window).contentWindow))
Wladimir Palant 2014/08/14 19:58:15 Please revert the changes in this file, the UI sho
Thomas Greiner 2014/08/29 15:57:29 Done.
state = "whitelisted";
}
@@ -1330,10 +1330,9 @@
*/
removeWhitelist: function(/**Window*/ window)
{
- let location = this.getCurrentLocation(window);
let filter = null;
- if (location)
- filter = Policy.isWhitelisted(location.spec);
+ let {getBrowser} = require("appSupport");
+ filter = Policy.isWindowWhitelisted(getBrowser(window).contentWindow);
if (filter && filter.subscriptions.length && !filter.disabled)
{
UI.toggleFilter(filter);
@@ -1682,8 +1681,8 @@
}
// Add "Remove exception" menu item if necessary
- let location = this.getCurrentLocation(window);
- let filter = (location ? Policy.isWhitelisted(location.spec) : null);
+ let {getBrowser} = require("appSupport");
+ let filter = Policy.isWindowWhitelisted(getBrowser(window).contentWindow);
if (filter && filter.subscriptions.length && !filter.disabled)
{
let label = this.overlay.attributes.whitelistcontextlabel;
« lib/filterClasses.js ('K') | « lib/matcher.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld