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 * @fileoverview | 6 * @fileoverview |
7 * 'site-list' shows a list of Allowed and Blocked sites for a given | 7 * 'site-list' shows a list of Allowed and Blocked sites for a given |
8 * category. | 8 * category. |
9 */ | 9 */ |
10 Polymer({ | 10 Polymer({ |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 /** | 177 /** |
178 * Whether there are any site exceptions added for this content setting. | 178 * Whether there are any site exceptions added for this content setting. |
179 * @return {boolean} | 179 * @return {boolean} |
180 * @private | 180 * @private |
181 */ | 181 */ |
182 hasSites_: function() { | 182 hasSites_: function() { |
183 return !!this.sites.length; | 183 return !!this.sites.length; |
184 }, | 184 }, |
185 | 185 |
186 /** | 186 /** |
187 * @param {chrome.settingsPrivate.Enforcement} enforcement The level of | 187 * @param {!SiteException} exception The content setting exception. |
188 * enforcement. | |
189 * @param {boolean} readOnlyList Whether the site exception list is read-only. | 188 * @param {boolean} readOnlyList Whether the site exception list is read-only. |
190 * @return {boolean} | 189 * @return {boolean} |
191 * @private | 190 * @private |
192 */ | 191 */ |
193 isResetButtonHidden_: function(enforcement, readOnlyList) { | 192 shouldHideResetButton_: function(exception, readOnlyList) { |
194 return enforcement == chrome.settingsPrivate.Enforcement.ENFORCED || | 193 return exception.enforcement == |
195 this.allSites || !readOnlyList; | 194 chrome.settingsPrivate.Enforcement.ENFORCED || |
| 195 this.allSites || !(readOnlyList || !!exception.embeddingOrigin); |
196 }, | 196 }, |
197 | 197 |
198 /** | 198 /** |
199 * @param {string} enforcement Whether the exception is controlled. | 199 * @param {!SiteException} exception The content setting exception. |
200 * @param {boolean} readOnlyList Whether the site exception list is read-only. | 200 * @param {boolean} readOnlyList Whether the site exception list is read-only. |
201 * @return {boolean} | 201 * @return {boolean} |
202 * @private | 202 * @private |
203 */ | 203 */ |
204 isActionMenuHidden_: function(enforcement, readOnlyList) { | 204 shouldHideActionMenu_: function(exception, readOnlyList) { |
205 return enforcement == chrome.settingsPrivate.Enforcement.ENFORCED || | 205 return exception.enforcement == |
206 this.allSites || readOnlyList; | 206 chrome.settingsPrivate.Enforcement.ENFORCED || |
| 207 this.allSites || readOnlyList || !!exception.embeddingOrigin; |
207 }, | 208 }, |
208 | 209 |
209 /** | 210 /** |
210 * A handler for the Add Site button. | 211 * A handler for the Add Site button. |
211 * @param {!Event} e | 212 * @param {!Event} e |
212 * @private | 213 * @private |
213 */ | 214 */ |
214 onAddSiteTap_: function(e) { | 215 onAddSiteTap_: function(e) { |
215 assert(!this.readOnlyList); | 216 assert(!this.readOnlyList); |
216 e.preventDefault(); | 217 e.preventDefault(); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 /** @private */ | 496 /** @private */ |
496 closeActionMenu_: function() { | 497 closeActionMenu_: function() { |
497 this.actionMenuSite_ = null; | 498 this.actionMenuSite_ = null; |
498 this.activeDialogAnchor_ = null; | 499 this.activeDialogAnchor_ = null; |
499 var actionMenu = /** @type {!CrActionMenuElement} */ ( | 500 var actionMenu = /** @type {!CrActionMenuElement} */ ( |
500 this.$$('dialog[is=cr-action-menu]')); | 501 this.$$('dialog[is=cr-action-menu]')); |
501 if (actionMenu.open) | 502 if (actionMenu.open) |
502 actionMenu.close(); | 503 actionMenu.close(); |
503 }, | 504 }, |
504 }); | 505 }); |
OLD | NEW |