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

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

Issue 2768243002: [MD settings] update content settings when incognito changes (Closed)
Patch Set: removed param Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/site_settings/site_list.js
diff --git a/chrome/browser/resources/settings/site_settings/site_list.js b/chrome/browser/resources/settings/site_settings/site_list.js
index 7765e36d08cbcab3489a2b7a9aeb1f3f86231df6..47b1c04d524c2cae41d1e775d57a5a9b17116da0 100644
--- a/chrome/browser/resources/settings/site_settings/site_list.js
+++ b/chrome/browser/resources/settings/site_settings/site_list.js
@@ -103,16 +103,6 @@ Polymer({
showSessionOnlyAction_: Boolean,
/**
- * Keeps track of the incognito status of the current profile (whether one
- * exists).
- * @private
- */
- incognitoProfileActive_: {
- type: Boolean,
- value: false,
- },
-
- /**
* All possible actions in the action menu.
* @private
*/
@@ -150,18 +140,21 @@ Polymer({
this.configureWidget_();
},
- onIncognitoStatusChanged_: function(incognitoEnabled) {
- // A change notification is not sent for each site that is deleted during
- // incognito profile destruction. Therefore, we reconfigure the list when
- // the incognito profile is destroyed, except for SESSION_ONLY, which won't
- // have any incognito exceptions.
+ /**
+ * Called for each site list when incognito is enabled or disabled. Only
+ * called on change (opening N incogito windows only fires one message).
+ * Another message is sent when the *last* incognito window closes.
+ * @private
+ */
+ onIncognitoStatusChanged_: function() {
+ // The SESSION_ONLY list won't have any incognito exceptions. (Minor
+ // optimization, not required).
if (this.categorySubtype == settings.PermissionValues.SESSION_ONLY)
return;
- if (this.incognitoProfileActive_)
- this.configureWidget_(); // The incognito profile is being destroyed.
-
- this.incognitoProfileActive_ = incognitoEnabled;
+ // A change notification is not sent for each site. So we repopulate the
+ // whole list when the incognito profile is created or destroyed.
+ this.populateList_();
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698