Chromium Code Reviews| Index: chrome/browser/resources/settings/site_settings/add_site_dialog.js |
| diff --git a/chrome/browser/resources/settings/site_settings/add_site_dialog.js b/chrome/browser/resources/settings/site_settings/add_site_dialog.js |
| index 6c09138011aecb0055a15394f7f2fafd4e795087..f186be3c13f1b01d43b473b94ad421d6d0d21a2e 100644 |
| --- a/chrome/browser/resources/settings/site_settings/add_site_dialog.js |
| +++ b/chrome/browser/resources/settings/site_settings/add_site_dialog.js |
| @@ -13,16 +13,23 @@ Polymer({ |
| behaviors: [SiteSettingsBehavior, WebUIListenerBehavior], |
| properties: { |
| + /* What kind of setting, e.g. Location, Camera, Cookies, and so on. */ |
| + category: String, |
| + |
| + /* Whether this is about an Allow, Block, SessionOnly, or other. */ |
| + contentSetting: String, |
|
dpapad
2016/11/08 00:12:32
As discussed, could this be typed as an enum inste
dschuyler
2016/11/08 00:40:50
Done.
|
| + |
| /** |
| * The site to add an exception for. |
| * @private |
| */ |
| site_: String, |
| + }, |
| - /** |
| - * Whether this is an allow exception this dialog is adding. |
| - */ |
| - allowException: Boolean, |
| + /** @override */ |
| + attached: function() { |
| + assert(this.category); |
| + assert(this.contentSetting); |
| }, |
| /** |
| @@ -33,7 +40,6 @@ Polymer({ |
| open: function(type) { |
| this.addWebUIListener('onIncognitoStatusChanged', |
| this.onIncognitoStatusChanged_.bind(this)); |
| - this.allowException = type == settings.PermissionValues.ALLOW; |
| this.browserProxy.updateIncognitoStatus(); |
| this.$.dialog.showModal(); |
| }, |
| @@ -76,8 +82,7 @@ Polymer({ |
| return; // Can happen when Enter is pressed. |
| var pattern = this.addPatternWildcard(this.site_); |
| this.browserProxy.setCategoryPermissionForOrigin( |
| - pattern, pattern, this.category, this.allowException ? |
| - settings.PermissionValues.ALLOW : settings.PermissionValues.BLOCK, |
| + pattern, pattern, this.category, this.contentSetting, |
| this.$.incognito.checked); |
| this.$.dialog.close(); |
| }, |