| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Enumeration mapping all possible controlled-by values for exceptions to | 6 * Enumeration mapping all possible controlled-by values for exceptions to |
| 7 * icons. | 7 * icons. |
| 8 * @enum {string} | 8 * @enum {string} |
| 9 */ | 9 */ |
| 10 var iconControlledBy = { | 10 var iconControlledBy = { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 showBlockAction_: Boolean, | 96 showBlockAction_: Boolean, |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * Whether to show the 'Clear on exit' action in the action | 99 * Whether to show the 'Clear on exit' action in the action |
| 100 * menu. | 100 * menu. |
| 101 * @private | 101 * @private |
| 102 */ | 102 */ |
| 103 showSessionOnlyAction_: Boolean, | 103 showSessionOnlyAction_: Boolean, |
| 104 | 104 |
| 105 /** | 105 /** |
| 106 * Keeps track of the incognito status of the current profile (whether one | |
| 107 * exists). | |
| 108 * @private | |
| 109 */ | |
| 110 incognitoProfileActive_: { | |
| 111 type: Boolean, | |
| 112 value: false, | |
| 113 }, | |
| 114 | |
| 115 /** | |
| 116 * All possible actions in the action menu. | 106 * All possible actions in the action menu. |
| 117 * @private | 107 * @private |
| 118 */ | 108 */ |
| 119 actions_: { | 109 actions_: { |
| 120 readOnly: true, | 110 readOnly: true, |
| 121 type: Object, | 111 type: Object, |
| 122 values: { | 112 values: { |
| 123 ALLOW: 'Allow', | 113 ALLOW: 'Allow', |
| 124 BLOCK: 'Block', | 114 BLOCK: 'Block', |
| 125 RESET: 'Reset', | 115 RESET: 'Reset', |
| (...skipping 17 matching lines...) Expand all Loading... |
| 143 * Called when a site changes permission. | 133 * Called when a site changes permission. |
| 144 * @param {string} category The category of the site that changed. | 134 * @param {string} category The category of the site that changed. |
| 145 * @param {string} site The site that changed. | 135 * @param {string} site The site that changed. |
| 146 * @private | 136 * @private |
| 147 */ | 137 */ |
| 148 siteWithinCategoryChanged_: function(category, site) { | 138 siteWithinCategoryChanged_: function(category, site) { |
| 149 if (category == this.category || this.allSites) | 139 if (category == this.category || this.allSites) |
| 150 this.configureWidget_(); | 140 this.configureWidget_(); |
| 151 }, | 141 }, |
| 152 | 142 |
| 153 onIncognitoStatusChanged_: function(incognitoEnabled) { | 143 /** |
| 154 // A change notification is not sent for each site that is deleted during | 144 * Called for each site list when incognito is enabled or disabled. Only |
| 155 // incognito profile destruction. Therefore, we reconfigure the list when | 145 * called on change (opening N incogito windows only fires one message). |
| 156 // the incognito profile is destroyed, except for SESSION_ONLY, which won't | 146 * Another message is sent when the *last* incognito window closes. |
| 157 // have any incognito exceptions. | 147 * @private |
| 148 */ |
| 149 onIncognitoStatusChanged_: function() { |
| 150 // The SESSION_ONLY list won't have any incognito exceptions. (Minor |
| 151 // optimization, not required). |
| 158 if (this.categorySubtype == settings.PermissionValues.SESSION_ONLY) | 152 if (this.categorySubtype == settings.PermissionValues.SESSION_ONLY) |
| 159 return; | 153 return; |
| 160 | 154 |
| 161 if (this.incognitoProfileActive_) | 155 // A change notification is not sent for each site. So we repopulate the |
| 162 this.configureWidget_(); // The incognito profile is being destroyed. | 156 // whole list when the incognito profile is created or destroyed. |
| 163 | 157 this.populateList_(); |
| 164 this.incognitoProfileActive_ = incognitoEnabled; | |
| 165 }, | 158 }, |
| 166 | 159 |
| 167 /** | 160 /** |
| 168 * Configures the action menu, visibility of the widget and shows the list. | 161 * Configures the action menu, visibility of the widget and shows the list. |
| 169 * @private | 162 * @private |
| 170 */ | 163 */ |
| 171 configureWidget_: function() { | 164 configureWidget_: function() { |
| 172 // The observer for All Sites fires before the attached/ready event, so | 165 // The observer for All Sites fires before the attached/ready event, so |
| 173 // initialize this here. | 166 // initialize this here. |
| 174 if (this.browserProxy_ === undefined) { | 167 if (this.browserProxy_ === undefined) { |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 497 |
| 505 /** @private */ | 498 /** @private */ |
| 506 closeActionMenu_: function() { | 499 closeActionMenu_: function() { |
| 507 this.actionMenuSite_ = null; | 500 this.actionMenuSite_ = null; |
| 508 var actionMenu = /** @type {!CrActionMenuElement} */ ( | 501 var actionMenu = /** @type {!CrActionMenuElement} */ ( |
| 509 this.$$('dialog[is=cr-action-menu]')); | 502 this.$$('dialog[is=cr-action-menu]')); |
| 510 if (actionMenu.open) | 503 if (actionMenu.open) |
| 511 actionMenu.close(); | 504 actionMenu.close(); |
| 512 }, | 505 }, |
| 513 }); | 506 }); |
| OLD | NEW |