| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 /** | 248 /** |
| 249 * Retrieves a list of all known sites (any category/setting). | 249 * Retrieves a list of all known sites (any category/setting). |
| 250 * @return {!Promise} | 250 * @return {!Promise} |
| 251 * @private | 251 * @private |
| 252 */ | 252 */ |
| 253 getAllSitesList_: function() { | 253 getAllSitesList_: function() { |
| 254 var promiseList = []; | 254 var promiseList = []; |
| 255 for (var type in settings.ContentSettingsTypes) { | 255 for (var type in settings.ContentSettingsTypes) { |
| 256 if (settings.ContentSettingsTypes[type] == | 256 if (settings.ContentSettingsTypes[type] == |
| 257 settings.ContentSettingsTypes.PROTOCOL_HANDLERS) { | 257 settings.ContentSettingsTypes.PROTOCOL_HANDLERS || |
| 258 // Protocol handlers don't have data stored the way all the other | 258 settings.ContentSettingsTypes[type] == |
| 259 // categories do. | 259 settings.ContentSettingsTypes.USB_DEVICES) { |
| 260 // Protocol handlers and USB devices don't have data stored the way all |
| 261 // the other categories do. |
| 260 continue; | 262 continue; |
| 261 } | 263 } |
| 262 | 264 |
| 263 promiseList.push( | 265 promiseList.push( |
| 264 this.browserProxy_.getExceptionList( | 266 this.browserProxy_.getExceptionList( |
| 265 settings.ContentSettingsTypes[type])); | 267 settings.ContentSettingsTypes[type])); |
| 266 } | 268 } |
| 267 | 269 |
| 268 return Promise.all(promiseList); | 270 return Promise.all(promiseList); |
| 269 }, | 271 }, |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 // is redundant to also list all the sites that are blocked. | 479 // is redundant to also list all the sites that are blocked. |
| 478 if (this.isAllowList_()) | 480 if (this.isAllowList_()) |
| 479 return true; | 481 return true; |
| 480 | 482 |
| 481 if (this.isSessionOnlyList_()) | 483 if (this.isSessionOnlyList_()) |
| 482 return siteList.length > 0; | 484 return siteList.length > 0; |
| 483 | 485 |
| 484 return toggleState; | 486 return toggleState; |
| 485 }, | 487 }, |
| 486 }); | 488 }); |
| OLD | NEW |