Chromium Code Reviews| Index: chrome/browser/resources/settings/site_settings/edit_exception_dialog.js |
| diff --git a/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js b/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..34fc0e945f484831ae98ba711c50a0843305b920 |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js |
| @@ -0,0 +1,70 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** |
| + * @fileoverview 'settings-edit-exception-dialog' is a component for editing a |
| + * site exception entry. |
| + */ |
| +Polymer({ |
| + is: 'settings-edit-exception-dialog', |
| + |
| + properties: { |
| + /** |
| + * @type {!SiteException} |
| + */ |
| + model: Object, |
| + |
| + /** @private */ |
| + origin_: String, |
| + }, |
| + |
| + /** @private {!settings.SiteSettingsPrefsBrowserProxy} */ |
| + browserProxy_: null, |
| + |
| + /** @override */ |
| + attached: function() { |
| + this.browserProxy_ = |
| + settings.SiteSettingsPrefsBrowserProxyImpl.getInstance(); |
| + this.origin_ = this.model.origin; |
| + |
| + this.$.dialog.showModal(); |
| + }, |
| + |
| + /** @private */ |
| + onCancelTap_: function() { |
| + this.$.dialog.close(); |
| + }, |
| + |
| + /** @private */ |
| + onActionButtonTap_: function() { |
| + if (this.model.origin != this.origin_) { |
| + // Only COOKIES category can be edited currently. |
| + var category = settings.ContentSettingsTypes.COOKIES; |
|
dschuyler
2017/02/23 01:31:49
I see that the bug is specific to Cookies, but thi
dpapad
2017/02/23 19:39:47
Done, https://bugs.chromium.org/p/chromium/issues/
|
| + |
| + this.browserProxy_.resetCategoryPermissionForOrigin( |
| + this.model.origin, |
| + this.model.embeddingOrigin, |
| + category, |
| + this.model.incognito); |
| + |
| + this.browserProxy_.setCategoryPermissionForOrigin( |
| + this.origin_, |
| + this.origin_, |
| + category, |
| + this.model.setting, |
| + this.model.incognito); |
| + } |
| + |
| + this.$.dialog.close(); |
| + }, |
| + |
| + /** |
| + * @param {!KeyboardEvent} e |
| + * @private |
| + */ |
| + onKeypress_: function(e) { |
| + if (e.key == 'Enter' && !this.$.actionButton.disabled) |
| + this.onActionButtonTap_(); |
| + }, |
| +}); |