diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-12 14:07:37 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-17 10:29:26 +0000 |
commit | ec02ee4181c49b61fce1c8fb99292dbb8139cc90 (patch) | |
tree | 25cde714b2b71eb639d1cd53f5a22e9ba76e14ef /chromium/chrome/browser/resources/settings/site_settings/add_site_dialog.js | |
parent | bb09965444b5bb20b096a291445170876225268d (diff) |
BASELINE: Update Chromium to 59.0.3071.134
Change-Id: Id02ef6fb2204c5fd21668a1c3e6911c83b17585a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/chrome/browser/resources/settings/site_settings/add_site_dialog.js')
-rw-r--r-- | chromium/chrome/browser/resources/settings/site_settings/add_site_dialog.js | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/chromium/chrome/browser/resources/settings/site_settings/add_site_dialog.js b/chromium/chrome/browser/resources/settings/site_settings/add_site_dialog.js index 59d1ac63ff9..41eecca19c8 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/add_site_dialog.js +++ b/chromium/chrome/browser/resources/settings/site_settings/add_site_dialog.js @@ -25,6 +25,9 @@ Polymer({ */ contentSetting: String, + /** @private */ + showIncognitoSessionOnly_: Boolean, + /** * The site to add an exception for. * @private @@ -44,8 +47,10 @@ Polymer({ * Block list. */ open: function(type) { - this.addWebUIListener('onIncognitoStatusChanged', - this.onIncognitoStatusChanged_.bind(this)); + this.addWebUIListener('onIncognitoStatusChanged', function(isActive) { + this.showIncognitoSessionOnly_ = isActive && + this.contentSetting != settings.PermissionValues.SESSION_ONLY; + }.bind(this)); this.browserProxy.updateIncognitoStatus(); this.$.dialog.showModal(); }, @@ -55,7 +60,16 @@ Polymer({ * @private */ validate_: function() { + // If input is empty, disable the action button, but don't show the red + // invalid message. + if (this.$.site.value.trim() == '') { + this.$.site.invalid = false; + this.$.add.disabled = true; + return; + } + this.browserProxy.isPatternValid(this.site_).then(function(isValid) { + this.$.site.invalid = !isValid; this.$.add.disabled = !isValid; }.bind(this)); }, @@ -66,19 +80,6 @@ Polymer({ }, /** - * A handler for when we get notified of the current profile creating or - * destroying their incognito counterpart. - * @param {boolean} incognitoEnabled Whether the current profile has an - * incognito profile. - * @private - */ - onIncognitoStatusChanged_: function(incognitoEnabled) { - this.$.incognito.disabled = !incognitoEnabled; - if (!incognitoEnabled) - this.$.incognito.checked = false; - }, - - /** * The tap handler for the Add [Site] button (adds the pattern and closes * the dialog). * @private |