diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-04 14:17:57 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-05 10:05:06 +0000 |
commit | 39d357e3248f80abea0159765ff39554affb40db (patch) | |
tree | aba0e6bfb76de0244bba0f5fdbd64b830dd6e621 /chromium/chrome/browser/resources/settings/site_settings/add_site_dialog.js | |
parent | 87778abf5a1f89266f37d1321b92a21851d8244d (diff) |
BASELINE: Update Chromium to 55.0.2883.105
And updates ninja to 1.7.2
Change-Id: I20d43c737f82764d857ada9a55586901b18b9243
Reviewed-by: Michael BrĂ¼ning <michael.bruning@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 | 37 |
1 files changed, 29 insertions, 8 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 3a2c55907da..6c09138011a 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 @@ -10,7 +10,7 @@ Polymer({ is: 'add-site-dialog', - behaviors: [SiteSettingsBehavior], + behaviors: [SiteSettingsBehavior, WebUIListenerBehavior], properties: { /** @@ -31,8 +31,11 @@ Polymer({ * Block list. */ open: function(type) { + this.addWebUIListener('onIncognitoStatusChanged', + this.onIncognitoStatusChanged_.bind(this)); this.allowException = type == settings.PermissionValues.ALLOW; - this.$.dialog.open(); + this.browserProxy.updateIncognitoStatus(); + this.$.dialog.showModal(); }, /** @@ -40,12 +43,29 @@ Polymer({ * @private */ validate_: function() { - var pattern = this.addPatternWildcard_(this.site_); - this.browserProxy.isPatternValid(pattern).then(function(isValid) { + this.browserProxy.isPatternValid(this.site_).then(function(isValid) { this.$.add.disabled = !isValid; }.bind(this)); }, + /** @private */ + onCancelTap_: function() { + this.$.dialog.cancel(); + }, + + /** + * 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). @@ -54,10 +74,11 @@ Polymer({ onSubmit_: function() { if (this.$.add.disabled) return; // Can happen when Enter is pressed. - var pattern = this.addPatternWildcard_(this.site_); - this.setCategoryPermissionForOrigin( - pattern, '', this.category, this.allowException ? - settings.PermissionValues.ALLOW : settings.PermissionValues.BLOCK); + var pattern = this.addPatternWildcard(this.site_); + this.browserProxy.setCategoryPermissionForOrigin( + pattern, pattern, this.category, this.allowException ? + settings.PermissionValues.ALLOW : settings.PermissionValues.BLOCK, + this.$.incognito.checked); this.$.dialog.close(); }, }); |