| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 * Retrieves a list of all known sites (any category/setting). | 274 * Retrieves a list of all known sites (any category/setting). |
| 275 * @return {!Promise} | 275 * @return {!Promise} |
| 276 * @private | 276 * @private |
| 277 */ | 277 */ |
| 278 getAllSitesList_: function() { | 278 getAllSitesList_: function() { |
| 279 var promiseList = []; | 279 var promiseList = []; |
| 280 for (var type in settings.ContentSettingsTypes) { | 280 for (var type in settings.ContentSettingsTypes) { |
| 281 if (settings.ContentSettingsTypes[type] == | 281 if (settings.ContentSettingsTypes[type] == |
| 282 settings.ContentSettingsTypes.PROTOCOL_HANDLERS || | 282 settings.ContentSettingsTypes.PROTOCOL_HANDLERS || |
| 283 settings.ContentSettingsTypes[type] == | 283 settings.ContentSettingsTypes[type] == |
| 284 settings.ContentSettingsTypes.USB_DEVICES) { | 284 settings.ContentSettingsTypes.USB_DEVICES || |
| 285 // Protocol handlers and USB devices don't have data stored the way all | 285 settings.ContentSettingsTypes[type] == |
| 286 // the other categories do. | 286 settings.ContentSettingsTypes.ZOOM_LEVELS) { |
| 287 // Some categories store their data in a custom way. |
| 287 continue; | 288 continue; |
| 288 } | 289 } |
| 289 | 290 |
| 290 promiseList.push( | 291 promiseList.push( |
| 291 this.browserProxy_.getExceptionList( | 292 this.browserProxy_.getExceptionList( |
| 292 settings.ContentSettingsTypes[type])); | 293 settings.ContentSettingsTypes[type])); |
| 293 } | 294 } |
| 294 | 295 |
| 295 return Promise.all(promiseList); | 296 return Promise.all(promiseList); |
| 296 }, | 297 }, |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 // is redundant to also list all the sites that are blocked. | 533 // is redundant to also list all the sites that are blocked. |
| 533 if (this.isAllowList_()) | 534 if (this.isAllowList_()) |
| 534 return true; | 535 return true; |
| 535 | 536 |
| 536 if (this.isSessionOnlyList_()) | 537 if (this.isSessionOnlyList_()) |
| 537 return siteList.length > 0; | 538 return siteList.length > 0; |
| 538 | 539 |
| 539 return toggleState; | 540 return toggleState; |
| 540 }, | 541 }, |
| 541 }); | 542 }); |
| OLD | NEW |