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

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

Issue 2617663002: WIP: run clang-format-js on lots of things (Closed)
Patch Set: merge Created 3 years, 11 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
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 26 matching lines...) Expand all
37 assert(this.category); 37 assert(this.category);
38 assert(this.contentSetting); 38 assert(this.contentSetting);
39 }, 39 },
40 40
41 /** 41 /**
42 * Opens the dialog. 42 * Opens the dialog.
43 * @param {string} type Whether this was launched from an Allow list or a 43 * @param {string} type Whether this was launched from an Allow list or a
44 * Block list. 44 * Block list.
45 */ 45 */
46 open: function(type) { 46 open: function(type) {
47 this.addWebUIListener('onIncognitoStatusChanged', 47 this.addWebUIListener(
48 this.onIncognitoStatusChanged_.bind(this)); 48 'onIncognitoStatusChanged', this.onIncognitoStatusChanged_.bind(this));
49 this.browserProxy.updateIncognitoStatus(); 49 this.browserProxy.updateIncognitoStatus();
50 this.$.dialog.showModal(); 50 this.$.dialog.showModal();
51 }, 51 },
52 52
53 /** 53 /**
54 * Validates that the pattern entered is valid. 54 * Validates that the pattern entered is valid.
55 * @private 55 * @private
56 */ 56 */
57 validate_: function() { 57 validate_: function() {
58 this.browserProxy.isPatternValid(this.site_).then(function(isValid) { 58 this.browserProxy.isPatternValid(this.site_).then(function(isValid) {
(...skipping 27 matching lines...) Expand all
86 onSubmit_: function() { 86 onSubmit_: function() {
87 if (this.$.add.disabled) 87 if (this.$.add.disabled)
88 return; // Can happen when Enter is pressed. 88 return; // Can happen when Enter is pressed.
89 var pattern = this.addPatternWildcard(this.site_); 89 var pattern = this.addPatternWildcard(this.site_);
90 this.browserProxy.setCategoryPermissionForOrigin( 90 this.browserProxy.setCategoryPermissionForOrigin(
91 pattern, pattern, this.category, this.contentSetting, 91 pattern, pattern, this.category, this.contentSetting,
92 this.$.incognito.checked); 92 this.$.incognito.checked);
93 this.$.dialog.close(); 93 this.$.dialog.close();
94 }, 94 },
95 }); 95 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698