Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2955)

Unified Diff: chrome/browser/resources/settings/site_settings/add_site_dialog.js

Issue 2298283002: Site Settings Desktop: Support adding exceptions for incognito mode. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/site_settings/add_site_dialog.js
diff --git a/chrome/browser/resources/settings/site_settings/add_site_dialog.js b/chrome/browser/resources/settings/site_settings/add_site_dialog.js
index e7ceeed3a5363371a2980eb12ebdfa2e3e22affa..bec0645b734b62d781378f6a49048567de44ea82 100644
--- a/chrome/browser/resources/settings/site_settings/add_site_dialog.js
+++ b/chrome/browser/resources/settings/site_settings/add_site_dialog.js
@@ -10,7 +10,7 @@
Polymer({
is: 'add-site-dialog',
- behaviors: [SiteSettingsBehavior],
+ behaviors: [SiteSettingsBehavior, WebUIListenerBehavior],
properties: {
/**
@@ -31,7 +31,10 @@ Polymer({
* Block list.
*/
open: function(type) {
+ this.addWebUIListener('onIncognitoStatusChanged',
+ this.onIncognitoStatusChanged_.bind(this));
this.allowException = type == settings.PermissionValues.ALLOW;
+ this.browserProxy.updateIncognitoStatus();
this.$.dialog.showModal();
},
@@ -60,9 +63,23 @@ Polymer({
if (this.$.add.disabled)
return; // Can happen when Enter is pressed.
var pattern = this.addPatternWildcard(this.site_);
- this.setCategoryPermissionForOrigin(
+ this.browserProxy.setCategoryPermissionForOrigin(
pattern, pattern, this.category, this.allowException ?
- settings.PermissionValues.ALLOW : settings.PermissionValues.BLOCK);
+ settings.PermissionValues.ALLOW : settings.PermissionValues.BLOCK,
+ this.$.incognito.checked);
this.$.dialog.close();
},
+
+ /**
+ * A handler for when we get notified of the current profile creating or
+ * destroying their incognito counterpart.
+ * @param {boolean} incognitoEnabled Whether the current profile has an
+ * incognito profile.
+ * @private
+ */
dschuyler 2016/08/31 21:48:52 nit: This function could sort alphabetically above
Finnur 2016/09/01 11:10:15 Done.
+ onIncognitoStatusChanged_: function(incognitoEnabled) {
+ this.$.incognito.disabled = !incognitoEnabled;
+ if (!incognitoEnabled)
+ this.$.incognito.checked = false;
+ },
});

Powered by Google App Engine
This is Rietveld 408576698