OLD | NEW |
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 'settings-startup-url-dialog' is a component for adding | 6 * @fileoverview 'settings-startup-url-dialog' is a component for adding |
7 * or editing a startup URL entry. | 7 * or editing a startup URL entry. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-startup-url-dialog', | 10 is: 'settings-startup-url-dialog', |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 onCancelTap_: function() { | 52 onCancelTap_: function() { |
53 this.$.dialog.close(); | 53 this.$.dialog.close(); |
54 }, | 54 }, |
55 | 55 |
56 /** @private */ | 56 /** @private */ |
57 onActionButtonTap_: function() { | 57 onActionButtonTap_: function() { |
58 var whenDone = this.model ? | 58 var whenDone = this.model ? |
59 this.browserProxy_.editStartupPage(this.model.modelIndex, this.url_) : | 59 this.browserProxy_.editStartupPage(this.model.modelIndex, this.url_) : |
60 this.browserProxy_.addStartupPage(this.url_); | 60 this.browserProxy_.addStartupPage(this.url_); |
61 | 61 |
62 whenDone.then(function(success) { | 62 whenDone.then(success => { |
63 if (success) | 63 if (success) |
64 this.$.dialog.close(); | 64 this.$.dialog.close(); |
65 // If the URL was invalid, there is nothing to do, just leave the dialog | 65 // If the URL was invalid, there is nothing to do, just leave the dialog |
66 // open and let the user fix the URL or cancel. | 66 // open and let the user fix the URL or cancel. |
67 }.bind(this)); | 67 }); |
68 }, | 68 }, |
69 | 69 |
70 /** @private */ | 70 /** @private */ |
71 validate_: function() { | 71 validate_: function() { |
72 this.browserProxy_.validateStartupPage(this.url_).then(function(isValid) { | 72 this.browserProxy_.validateStartupPage(this.url_).then(isValid => { |
73 this.$.actionButton.disabled = !isValid; | 73 this.$.actionButton.disabled = !isValid; |
74 }.bind(this)); | 74 }); |
75 }, | 75 }, |
76 }); | 76 }); |
OLD | NEW |