| 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 * Example: | 10 * Example: |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 this.sites_ = newList; | 152 this.sites_ = newList; |
| 153 }, | 153 }, |
| 154 | 154 |
| 155 /** | 155 /** |
| 156 * Setup the values to use for the action menu. | 156 * Setup the values to use for the action menu. |
| 157 * @private | 157 * @private |
| 158 */ | 158 */ |
| 159 setUpActionMenu_: function() { | 159 setUpActionMenu_: function() { |
| 160 this.showAllowAction_ = | 160 this.showAllowAction_ = |
| 161 this.categorySubtype == settings.DefaultValues.BLOCK; | 161 this.categorySubtype == settings.PermissionValues.BLOCK; |
| 162 this.showBlockAction_ = | 162 this.showBlockAction_ = |
| 163 this.categorySubtype == settings.DefaultValues.ALLOW && | 163 this.categorySubtype == settings.PermissionValues.ALLOW && |
| 164 this.category != settings.ContentSettingsTypes.FULLSCREEN; | 164 this.category != settings.ContentSettingsTypes.FULLSCREEN; |
| 165 }, | 165 }, |
| 166 | 166 |
| 167 /** | 167 /** |
| 168 * A handler for selecting a site (by clicking on the origin). | 168 * A handler for selecting a site (by clicking on the origin). |
| 169 * @private | 169 * @private |
| 170 */ | 170 */ |
| 171 onOriginTap_: function(event) { | 171 onOriginTap_: function(event) { |
| 172 this.selectedOrigin = event.model.item.url; | 172 this.selectedOrigin = event.model.item.url; |
| 173 }, | 173 }, |
| 174 | 174 |
| 175 /** | 175 /** |
| 176 * A handler for activating one of the menu action items. | 176 * A handler for activating one of the menu action items. |
| 177 * @private | 177 * @private |
| 178 */ | 178 */ |
| 179 onActionMenuIronSelect_: function(event) { | 179 onActionMenuIronSelect_: function(event) { |
| 180 // TODO(finnur): Implement. | 180 // TODO(finnur): Implement. |
| 181 }, | 181 }, |
| 182 | 182 |
| 183 /** | 183 /** |
| 184 * Returns the appropriate header value for display. | 184 * Returns the appropriate header value for display. |
| 185 * @param {array<string>} siteList The list of all sites to display for this | 185 * @param {array<string>} siteList The list of all sites to display for this |
| 186 * category subtype. | 186 * category subtype. |
| 187 * @param {boolean} toggleState The state of the global toggle for this | 187 * @param {boolean} toggleState The state of the global toggle for this |
| 188 * category. | 188 * category. |
| 189 * @private | 189 * @private |
| 190 */ | 190 */ |
| 191 computeSiteListHeader_: function(siteList, toggleState) { | 191 computeSiteListHeader_: function(siteList, toggleState) { |
| 192 if (this.categorySubtype == settings.DefaultValues.ALLOW) { | 192 if (this.categorySubtype == settings.PermissionValues.ALLOW) { |
| 193 return loadTimeData.getStringF( | 193 return loadTimeData.getStringF( |
| 194 'titleAndCount', | 194 'titleAndCount', |
| 195 loadTimeData.getString( | 195 loadTimeData.getString( |
| 196 toggleState ? 'siteSettingsAllow' : 'siteSettingsExceptions'), | 196 toggleState ? 'siteSettingsAllow' : 'siteSettingsExceptions'), |
| 197 siteList.length); | 197 siteList.length); |
| 198 } else { | 198 } else { |
| 199 return loadTimeData.getStringF( | 199 return loadTimeData.getStringF( |
| 200 'titleAndCount', | 200 'titleAndCount', |
| 201 loadTimeData.getString('siteSettingsBlock'), | 201 loadTimeData.getString('siteSettingsBlock'), |
| 202 siteList.length); | 202 siteList.length); |
| 203 } | 203 } |
| 204 }, | 204 }, |
| 205 | 205 |
| 206 /** | 206 /** |
| 207 * Returns true if this widget is showing the allow list. | 207 * Returns true if this widget is showing the allow list. |
| 208 * @private | 208 * @private |
| 209 */ | 209 */ |
| 210 isAllowList_: function() { | 210 isAllowList_: function() { |
| 211 return this.categorySubtype == settings.DefaultValues.ALLOW; | 211 return this.categorySubtype == settings.PermissionValues.ALLOW; |
| 212 }, | 212 }, |
| 213 | 213 |
| 214 /** | 214 /** |
| 215 * Returns whether to show the site list. | 215 * Returns whether to show the site list. |
| 216 * @param {array} siteList The list of all sites to display for this category | 216 * @param {array} siteList The list of all sites to display for this category |
| 217 * subtype. | 217 * subtype. |
| 218 * @param {boolean} toggleState The state of the global toggle for this | 218 * @param {boolean} toggleState The state of the global toggle for this |
| 219 * category. | 219 * category. |
| 220 * @private | 220 * @private |
| 221 */ | 221 */ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 234 * Returns the icon to use for a given site. | 234 * Returns the icon to use for a given site. |
| 235 * @param {string} url The url of the site to fetch the icon for. | 235 * @param {string} url The url of the site to fetch the icon for. |
| 236 * @private | 236 * @private |
| 237 */ | 237 */ |
| 238 computeSiteIcon_: function(url) { | 238 computeSiteIcon_: function(url) { |
| 239 // TODO(finnur): For now, we're returning a placeholder image for each site | 239 // TODO(finnur): For now, we're returning a placeholder image for each site |
| 240 // but the actual favicon for each site will need to be returned. | 240 // but the actual favicon for each site will need to be returned. |
| 241 return 'communication:message'; | 241 return 'communication:message'; |
| 242 }, | 242 }, |
| 243 }); | 243 }); |
| OLD | NEW |