Chromium Code Reviews| 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..e32f1610a89d662e21d7a997ee706808b36bbe06 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,22 @@ Polymer({ |
| this.configureWidget_(); |
| }, |
| + /** |
| + * 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. |
| + * @param {boolean} incognitoEnabled Unused. |
|
dpapad
2017/03/23 18:19:46
Can we omit the parameter since it is not used?
dschuyler
2017/03/23 21:09:06
Done.
|
| + * @private |
| + */ |
| 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. |
| + // 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_(); |
| }, |
| /** |