| 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 e00838e4d414cf100f3a5f76e57864c8d45abee0..3a2c55907da70c8605203b952ccd5d7041be7b57 100644
|
| --- a/chrome/browser/resources/settings/site_settings/add_site_dialog.js
|
| +++ b/chrome/browser/resources/settings/site_settings/add_site_dialog.js
|
| @@ -18,10 +18,20 @@ Polymer({
|
| * @private
|
| */
|
| site_: String,
|
| +
|
| + /**
|
| + * Whether this is an allow exception this dialog is adding.
|
| + */
|
| + allowException: Boolean,
|
| },
|
|
|
| - /** Opens the dialog. */
|
| - open: function() {
|
| + /**
|
| + * Opens the dialog.
|
| + * @param {string} type Whether this was launched from an Allow list or a
|
| + * Block list.
|
| + */
|
| + open: function(type) {
|
| + this.allowException = type == settings.PermissionValues.ALLOW;
|
| this.$.dialog.open();
|
| },
|
|
|
| @@ -41,10 +51,13 @@ Polymer({
|
| * the dialog).
|
| * @private
|
| */
|
| - onAddTap_: function() {
|
| + onSubmit_: function() {
|
| + if (this.$.add.disabled)
|
| + return; // Can happen when Enter is pressed.
|
| var pattern = this.addPatternWildcard_(this.site_);
|
| this.setCategoryPermissionForOrigin(
|
| - pattern, '', this.category, settings.PermissionValues.ALLOW);
|
| + pattern, '', this.category, this.allowException ?
|
| + settings.PermissionValues.ALLOW : settings.PermissionValues.BLOCK);
|
| this.$.dialog.close();
|
| },
|
| });
|
|
|