Chromium Code Reviews| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 {chrome.settingsPrivate.Enforcement} enforcement The level of |
| 188 * enforcement. | 188 * enforcement. |
| 189 * @param {boolean} readOnlyList Whether the site exception list is read-only. | 189 * @param {boolean} readOnlyList Whether the site exception list is read-only. |
| 190 * @param {!SiteException} item The content setting exception. | |
|
dpapad
2017/05/10 21:44:57
Nit: Maybe a more descriptive name would be |excep
dschuyler
2017/05/10 22:05:37
Done.
| |
| 190 * @return {boolean} | 191 * @return {boolean} |
| 191 * @private | 192 * @private |
| 192 */ | 193 */ |
| 193 isResetButtonHidden_: function(enforcement, readOnlyList) { | 194 isResetButtonHidden_: function(enforcement, readOnlyList, item) { |
|
dpapad
2017/05/10 21:44:57
Nit (optional): I think it would improve readabili
dschuyler
2017/05/10 22:05:37
Done.
| |
| 194 return enforcement == chrome.settingsPrivate.Enforcement.ENFORCED || | 195 return enforcement == chrome.settingsPrivate.Enforcement.ENFORCED || |
| 195 this.allSites || !readOnlyList; | 196 this.allSites || !(readOnlyList || !!item.embeddingOrigin); |
| 196 }, | 197 }, |
| 197 | 198 |
| 198 /** | 199 /** |
| 199 * @param {string} enforcement Whether the exception is controlled. | 200 * @param {string} enforcement Whether the exception is controlled. |
| 200 * @param {boolean} readOnlyList Whether the site exception list is read-only. | 201 * @param {boolean} readOnlyList Whether the site exception list is read-only. |
| 202 * @param {!SiteException} item The content setting exception. | |
| 201 * @return {boolean} | 203 * @return {boolean} |
| 202 * @private | 204 * @private |
| 203 */ | 205 */ |
| 204 isActionMenuHidden_: function(enforcement, readOnlyList) { | 206 isActionMenuHidden_: function(enforcement, readOnlyList, item) { |
| 205 return enforcement == chrome.settingsPrivate.Enforcement.ENFORCED || | 207 return enforcement == chrome.settingsPrivate.Enforcement.ENFORCED || |
| 206 this.allSites || readOnlyList; | 208 this.allSites || readOnlyList || !!item.embeddingOrigin; |
| 207 }, | 209 }, |
| 208 | 210 |
| 209 /** | 211 /** |
| 210 * A handler for the Add Site button. | 212 * A handler for the Add Site button. |
| 211 * @param {!Event} e | 213 * @param {!Event} e |
| 212 * @private | 214 * @private |
| 213 */ | 215 */ |
| 214 onAddSiteTap_: function(e) { | 216 onAddSiteTap_: function(e) { |
| 215 assert(!this.readOnlyList); | 217 assert(!this.readOnlyList); |
| 216 e.preventDefault(); | 218 e.preventDefault(); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 495 /** @private */ | 497 /** @private */ |
| 496 closeActionMenu_: function() { | 498 closeActionMenu_: function() { |
| 497 this.actionMenuSite_ = null; | 499 this.actionMenuSite_ = null; |
| 498 this.activeDialogAnchor_ = null; | 500 this.activeDialogAnchor_ = null; |
| 499 var actionMenu = /** @type {!CrActionMenuElement} */ ( | 501 var actionMenu = /** @type {!CrActionMenuElement} */ ( |
| 500 this.$$('dialog[is=cr-action-menu]')); | 502 this.$$('dialog[is=cr-action-menu]')); |
| 501 if (actionMenu.open) | 503 if (actionMenu.open) |
| 502 actionMenu.close(); | 504 actionMenu.close(); |
| 503 }, | 505 }, |
| 504 }); | 506 }); |
| OLD | NEW |