OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 'settings-edit-exception-dialog' is a component for editing a | 6 * @fileoverview 'settings-edit-exception-dialog' is a component for editing a |
7 * site exception entry. | 7 * site exception entry. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-edit-exception-dialog', | 10 is: 'settings-edit-exception-dialog', |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 /** @private */ | 43 /** @private */ |
44 onCancelTap_: function() { | 44 onCancelTap_: function() { |
45 this.$.dialog.close(); | 45 this.$.dialog.close(); |
46 }, | 46 }, |
47 | 47 |
48 /** @private */ | 48 /** @private */ |
49 onActionButtonTap_: function() { | 49 onActionButtonTap_: function() { |
50 if (this.model.origin != this.origin_) { | 50 if (this.model.origin != this.origin_) { |
51 // The way to "edit" an exception is to remove it and and a new one. | 51 // The way to "edit" an exception is to remove it and and a new one. |
52 this.browserProxy_.resetCategoryPermissionForOrigin( | 52 this.browserProxy_.resetCategoryPermissionForOrigin( |
53 this.model.origin, | 53 this.model.origin, this.model.embeddingOrigin, this.model.category, |
54 this.model.embeddingOrigin, | |
55 this.model.category, | |
56 this.model.incognito); | 54 this.model.incognito); |
57 | 55 |
58 this.browserProxy_.setCategoryPermissionForOrigin( | 56 this.browserProxy_.setCategoryPermissionForOrigin( |
59 this.origin_, | 57 this.origin_, this.origin_, this.model.category, this.model.setting, |
60 this.origin_, | |
61 this.model.category, | |
62 this.model.setting, | |
63 this.model.incognito); | 58 this.model.incognito); |
64 } | 59 } |
65 | 60 |
66 this.$.dialog.close(); | 61 this.$.dialog.close(); |
67 }, | 62 }, |
68 | 63 |
69 /** @private */ | 64 /** @private */ |
70 validate_: function() { | 65 validate_: function() { |
71 if (this.$$('paper-input').value.trim() == '') { | 66 if (this.$$('paper-input').value.trim() == '') { |
72 this.invalid_ = true; | 67 this.invalid_ = true; |
73 return; | 68 return; |
74 } | 69 } |
75 | 70 |
76 this.browserProxy_.isPatternValid(this.origin_).then(function(isValid) { | 71 this.browserProxy_.isPatternValid(this.origin_).then(function(isValid) { |
77 this.invalid_ = !isValid; | 72 this.invalid_ = !isValid; |
78 }.bind(this)); | 73 }.bind(this)); |
79 }, | 74 }, |
80 }); | 75 }); |
OLD | NEW |