| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 actionMenuSite_: Object, | 51 actionMenuSite_: Object, |
| 52 | 52 |
| 53 /** | 53 /** |
| 54 * Whether the "edit exception" dialog should be shown. | 54 * Whether the "edit exception" dialog should be shown. |
| 55 * @private | 55 * @private |
| 56 */ | 56 */ |
| 57 showEditExceptionDialog_: Boolean, | 57 showEditExceptionDialog_: Boolean, |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Array of sites to display in the widget. | 60 * Array of sites to display in the widget. |
| 61 * @type {!Array<SiteException>} | 61 * @private {!Array<SiteException>} |
| 62 */ | 62 */ |
| 63 sites: { | 63 sites_: { |
| 64 type: Array, | 64 type: Array, |
| 65 value: function() { return []; }, | 65 value: function() { return []; }, |
| 66 }, | 66 }, |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * Whether this list is for the All Sites category. | 69 * Whether this list is for the All Sites category. |
| 70 */ | 70 */ |
| 71 allSites: { | 71 allSites: { |
| 72 type: Boolean, | 72 type: Boolean, |
| 73 value: false, | 73 value: false, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 return ''; | 192 return ''; |
| 193 return iconControlledBy[item.source] || ''; | 193 return iconControlledBy[item.source] || ''; |
| 194 }, | 194 }, |
| 195 | 195 |
| 196 /** | 196 /** |
| 197 * Whether there are any site exceptions added for this content setting. | 197 * Whether there are any site exceptions added for this content setting. |
| 198 * @return {boolean} | 198 * @return {boolean} |
| 199 * @private | 199 * @private |
| 200 */ | 200 */ |
| 201 hasSites_: function() { | 201 hasSites_: function() { |
| 202 return !!this.sites.length; | 202 return !!this.sites_.length; |
| 203 }, | 203 }, |
| 204 | 204 |
| 205 /** | 205 /** |
| 206 * @param {string} source Where the setting came from. | 206 * @param {string} source Where the setting came from. |
| 207 * @param {boolean} readOnlyList Whether the site exception list is read-only. | 207 * @param {boolean} readOnlyList Whether the site exception list is read-only. |
| 208 * @return {boolean} | 208 * @return {boolean} |
| 209 * @private | 209 * @private |
| 210 */ | 210 */ |
| 211 isActionMenuHidden_: function(source, readOnlyList) { | 211 isActionMenuHidden_: function(source, readOnlyList) { |
| 212 return this.isExceptionControlled_(source) || this.allSites || readOnlyList; | 212 return this.isExceptionControlled_(source) || this.allSites || readOnlyList; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 /** | 254 /** |
| 255 * Process the exception list returned from the native layer. | 255 * Process the exception list returned from the native layer. |
| 256 * @param {!Array<!Array<SiteException>>} data List of sites (exceptions) to | 256 * @param {!Array<!Array<SiteException>>} data List of sites (exceptions) to |
| 257 * process. | 257 * process. |
| 258 * @private | 258 * @private |
| 259 */ | 259 */ |
| 260 processExceptions_: function(data) { | 260 processExceptions_: function(data) { |
| 261 var sites = []; | 261 var sites = []; |
| 262 for (var i = 0; i < data.length; ++i) | 262 for (var i = 0; i < data.length; ++i) |
| 263 sites = this.appendSiteList_(sites, data[i]); | 263 sites = this.appendSiteList_(sites, data[i]); |
| 264 this.sites = this.toSiteArray_(sites); | 264 this.sites_ = this.toSiteArray_(sites); |
| 265 }, | 265 }, |
| 266 | 266 |
| 267 /** | 267 /** |
| 268 * Retrieves a list of all known sites (any category/setting). | 268 * Retrieves a list of all known sites (any category/setting). |
| 269 * @return {!Promise} | 269 * @return {!Promise} |
| 270 * @private | 270 * @private |
| 271 */ | 271 */ |
| 272 getAllSitesList_: function() { | 272 getAllSitesList_: function() { |
| 273 var promiseList = []; | 273 var promiseList = []; |
| 274 for (var type in settings.ContentSettingsTypes) { | 274 for (var type in settings.ContentSettingsTypes) { |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 | 498 |
| 499 /** @private */ | 499 /** @private */ |
| 500 closeActionMenu_: function() { | 500 closeActionMenu_: function() { |
| 501 this.actionMenuSite_ = null; | 501 this.actionMenuSite_ = null; |
| 502 var actionMenu = /** @type {!CrActionMenuElement} */ ( | 502 var actionMenu = /** @type {!CrActionMenuElement} */ ( |
| 503 this.$$('dialog[is=cr-action-menu]')); | 503 this.$$('dialog[is=cr-action-menu]')); |
| 504 if (actionMenu.open) | 504 if (actionMenu.open) |
| 505 actionMenu.close(); | 505 actionMenu.close(); |
| 506 }, | 506 }, |
| 507 }); | 507 }); |
| OLD | NEW |