| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, |
| 54 this.model.embeddingOrigin, | 54 '', // Do not send an embeddedOrigin when editing. |
| 55 this.model.category, | 55 this.model.category, this.model.incognito); |
| 56 this.model.incognito); | |
| 57 | 56 |
| 58 this.browserProxy_.setCategoryPermissionForOrigin( | 57 this.browserProxy_.setCategoryPermissionForOrigin( |
| 59 this.origin_, | 58 this.origin_, |
| 60 this.origin_, | 59 this.origin_, |
| 61 this.model.category, | 60 this.model.category, |
| 62 this.model.setting, | 61 this.model.setting, |
| 63 this.model.incognito); | 62 this.model.incognito); |
| 64 } | 63 } |
| 65 | 64 |
| 66 this.$.dialog.close(); | 65 this.$.dialog.close(); |
| 67 }, | 66 }, |
| 68 | 67 |
| 69 /** @private */ | 68 /** @private */ |
| 70 validate_: function() { | 69 validate_: function() { |
| 71 if (this.$$('paper-input').value.trim() == '') { | 70 if (this.$$('paper-input').value.trim() == '') { |
| 72 this.invalid_ = true; | 71 this.invalid_ = true; |
| 73 return; | 72 return; |
| 74 } | 73 } |
| 75 | 74 |
| 76 this.browserProxy_.isPatternValid(this.origin_).then(function(isValid) { | 75 this.browserProxy_.isPatternValid(this.origin_).then(function(isValid) { |
| 77 this.invalid_ = !isValid; | 76 this.invalid_ = !isValid; |
| 78 }.bind(this)); | 77 }.bind(this)); |
| 79 }, | 78 }, |
| 80 }); | 79 }); |
| OLD | NEW |