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 * 'settings-site-list' shows a list of Allowed and Blocked sites for a given | 7 * 'settings-site-list' shows a list of Allowed and Blocked sites for a given |
8 * category. | 8 * category. |
9 */ | 9 */ |
10 Polymer({ | 10 Polymer({ |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 'configureWidget_(category, categorySubtype, categoryEnabled, allSites)' | 108 'configureWidget_(category, categorySubtype, categoryEnabled, allSites)' |
109 ], | 109 ], |
110 | 110 |
111 ready: function() { | 111 ready: function() { |
112 this.addWebUIListener('contentSettingSitePermissionChanged', | 112 this.addWebUIListener('contentSettingSitePermissionChanged', |
113 this.siteWithinCategoryChanged_.bind(this)); | 113 this.siteWithinCategoryChanged_.bind(this)); |
114 }, | 114 }, |
115 | 115 |
116 /** | 116 /** |
117 * Called when a site changes permission. | 117 * Called when a site changes permission. |
118 * @param {number} category The category of the site that changed. | 118 * @param {string} category The category of the site that changed. |
119 * @param {string} site The site that changed. | 119 * @param {string} site The site that changed. |
120 * @private | 120 * @private |
121 */ | 121 */ |
122 siteWithinCategoryChanged_: function(category, site) { | 122 siteWithinCategoryChanged_: function(category, site) { |
123 if (category == this.category) | 123 if (category == this.category) |
124 this.configureWidget_(); | 124 this.configureWidget_(); |
125 }, | 125 }, |
126 | 126 |
127 /** | 127 /** |
128 * Configures the action menu, visibility of the widget and shows the list. | 128 * Configures the action menu, visibility of the widget and shows the list. |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 return false; | 445 return false; |
446 | 446 |
447 // The Block list is only shown when the category is set to Allow since it | 447 // The Block list is only shown when the category is set to Allow since it |
448 // is redundant to also list all the sites that are blocked. | 448 // is redundant to also list all the sites that are blocked. |
449 if (this.isAllowList_()) | 449 if (this.isAllowList_()) |
450 return true; | 450 return true; |
451 | 451 |
452 return toggleState; | 452 return toggleState; |
453 }, | 453 }, |
454 }); | 454 }); |
OLD | NEW |