Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3631)

Unified Diff: chrome/browser/resources/settings/site_settings/edit_exception_dialog.js

Issue 2699013002: MD Settings: Allow editing a cookie site exception. (Closed)
Patch Set: Localize string. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_();
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698