summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js')
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js93
1 files changed, 0 insertions, 93 deletions
diff --git a/chromium/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js b/chromium/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js
deleted file mode 100644
index 87bba9081fc..00000000000
--- a/chromium/chrome/browser/resources/settings/site_settings/edit_exception_dialog.js
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2017 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: {
- type: Object,
- observer: 'modelChanged_',
- },
-
- /** @private */
- origin_: String,
-
- /**
- * The localized error message to display when the pattern is invalid.
- * @private
- */
- errorMessage_: String,
-
- /**
- * Whether the current input is invalid.
- * @private
- */
- invalid_: {
- type: Boolean,
- value: false,
- },
- },
-
- /** @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_) {
- // The way to "edit" an exception is to remove it and and a new one.
- this.browserProxy_.resetCategoryPermissionForPattern(
- this.model.origin, this.model.embeddingOrigin, this.model.category,
- this.model.incognito);
-
- this.browserProxy_.setCategoryPermissionForPattern(
- this.origin_, this.origin_, this.model.category, this.model.setting,
- this.model.incognito);
- }
-
- this.$.dialog.close();
- },
-
- /** @private */
- validate_: function() {
- if (this.$$('cr-input').value.trim() == '') {
- this.invalid_ = true;
- return;
- }
-
- this.browserProxy_.isPatternValidForType(this.origin_, this.model.category)
- .then(({isValid, reason}) => {
- this.invalid_ = !isValid;
- this.errorMessage_ = reason || '';
- });
- },
-
- /** @private */
- modelChanged_: function() {
- if (!this.model) {
- this.$.dialog.cancel();
- }
- },
-});