| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 this.onIncognitoStatusChanged_.bind(this)); | 111 this.onIncognitoStatusChanged_.bind(this)); |
| 112 }, | 112 }, |
| 113 | 113 |
| 114 /** | 114 /** |
| 115 * Called when a site changes permission. | 115 * Called when a site changes permission. |
| 116 * @param {string} category The category of the site that changed. | 116 * @param {string} category The category of the site that changed. |
| 117 * @param {string} site The site that changed. | 117 * @param {string} site The site that changed. |
| 118 * @private | 118 * @private |
| 119 */ | 119 */ |
| 120 siteWithinCategoryChanged_: function(category, site) { | 120 siteWithinCategoryChanged_: function(category, site) { |
| 121 if (category == this.category) | 121 if (category == this.category || this.category == settings.ALL_SITES) |
| 122 this.configureWidget_(); | 122 this.configureWidget_(); |
| 123 }, | 123 }, |
| 124 | 124 |
| 125 onIncognitoStatusChanged_: function(incognitoEnabled) { | 125 onIncognitoStatusChanged_: function(incognitoEnabled) { |
| 126 // A change notification is not sent for each site that is deleted during | 126 // A change notification is not sent for each site that is deleted during |
| 127 // incognito profile destruction. Therefore, we reconfigure the list when | 127 // incognito profile destruction. Therefore, we reconfigure the list when |
| 128 // the incognito profile is destroyed, except for SESSION_ONLY, which won't | 128 // the incognito profile is destroyed, except for SESSION_ONLY, which won't |
| 129 // have any incognito exceptions. | 129 // have any incognito exceptions. |
| 130 if (this.categorySubtype == settings.PermissionValues.SESSION_ONLY) | 130 if (this.categorySubtype == settings.PermissionValues.SESSION_ONLY) |
| 131 return; | 131 return; |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 // is redundant to also list all the sites that are blocked. | 500 // is redundant to also list all the sites that are blocked. |
| 501 if (this.isAllowList_()) | 501 if (this.isAllowList_()) |
| 502 return true; | 502 return true; |
| 503 | 503 |
| 504 if (this.isSessionOnlyList_()) | 504 if (this.isSessionOnlyList_()) |
| 505 return siteList.length > 0; | 505 return siteList.length > 0; |
| 506 | 506 |
| 507 return toggleState; | 507 return toggleState; |
| 508 }, | 508 }, |
| 509 }); | 509 }); |
| OLD | NEW |