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

Side by Side Diff: chrome/browser/resources/settings/site_settings/add_site_dialog.js

Issue 2854753002: [MD settings] clear incognito only checkbox (Closed)
Patch Set: review changes Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/site_list_tests.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'add-site-dialog' provides a dialog to add exceptions for a given Content 7 * 'add-site-dialog' provides a dialog to add exceptions for a given Content
8 * Settings category. 8 * Settings category.
9 */ 9 */
10 Polymer({ 10 Polymer({
(...skipping 23 matching lines...) Expand all
34 */ 34 */
35 site_: String, 35 site_: String,
36 }, 36 },
37 37
38 /** @override */ 38 /** @override */
39 attached: function() { 39 attached: function() {
40 assert(this.category); 40 assert(this.category);
41 assert(this.contentSetting); 41 assert(this.contentSetting);
42 }, 42 },
43 43
44 /** 44 /** Open the dialog. */
45 * Opens the dialog. 45 open: function() {
46 * @param {string} type Whether this was launched from an Allow list or a 46 this.addWebUIListener('onIncognitoStatusChanged', function(hasIncognito) {
47 * Block list. 47 this.$.incognito.checked = false;
48 */ 48 this.showIncognitoSessionOnly_ = hasIncognito &&
49 open: function(type) {
50 this.addWebUIListener('onIncognitoStatusChanged', function(isActive) {
51 this.showIncognitoSessionOnly_ = isActive &&
52 this.contentSetting != settings.PermissionValues.SESSION_ONLY; 49 this.contentSetting != settings.PermissionValues.SESSION_ONLY;
53 }.bind(this)); 50 }.bind(this));
54 this.browserProxy.updateIncognitoStatus(); 51 this.browserProxy.updateIncognitoStatus();
55 this.$.dialog.showModal(); 52 this.$.dialog.showModal();
56 }, 53 },
57 54
58 /** 55 /**
59 * Validates that the pattern entered is valid. 56 * Validates that the pattern entered is valid.
60 * @private 57 * @private
61 */ 58 */
(...skipping 24 matching lines...) Expand all
86 */ 83 */
87 onSubmit_: function() { 84 onSubmit_: function() {
88 if (this.$.add.disabled) 85 if (this.$.add.disabled)
89 return; // Can happen when Enter is pressed. 86 return; // Can happen when Enter is pressed.
90 this.browserProxy.setCategoryPermissionForOrigin( 87 this.browserProxy.setCategoryPermissionForOrigin(
91 this.site_, this.site_, this.category, this.contentSetting, 88 this.site_, this.site_, this.category, this.contentSetting,
92 this.$.incognito.checked); 89 this.$.incognito.checked);
93 this.$.dialog.close(); 90 this.$.dialog.close();
94 }, 91 },
95 }); 92 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/site_list_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698