| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 /** @private {!settings.SearchEnginesBrowserProxy} */ | 30 /** @private {!settings.SearchEnginesBrowserProxy} */ |
| 31 browserProxy_: null, | 31 browserProxy_: null, |
| 32 | 32 |
| 33 /** @override */ | 33 /** @override */ |
| 34 attached: function() { | 34 attached: function() { |
| 35 this.browserProxy_ = settings.StartupUrlsPageBrowserProxyImpl.getInstance(); | 35 this.browserProxy_ = settings.StartupUrlsPageBrowserProxyImpl.getInstance(); |
| 36 | 36 |
| 37 if (this.model) { | 37 if (this.model) { |
| 38 this.dialogTitle_ = loadTimeData.getString('onStartupEditPage'); | 38 this.dialogTitle_ = loadTimeData.getString('onStartupEditPage'); |
| 39 this.actionButtonText_ = loadTimeData.getString('edit'); | 39 this.actionButtonText_ = loadTimeData.getString('save'); |
| 40 this.$.actionButton.disabled = false; | 40 this.$.actionButton.disabled = false; |
| 41 // Pre-populate the input field. | 41 // Pre-populate the input field. |
| 42 this.url_ = this.model.url; | 42 this.url_ = this.model.url; |
| 43 } else { | 43 } else { |
| 44 this.dialogTitle_ = loadTimeData.getString('onStartupAddNewPage'); | 44 this.dialogTitle_ = loadTimeData.getString('onStartupAddNewPage'); |
| 45 this.actionButtonText_ = loadTimeData.getString('add'); | 45 this.actionButtonText_ = loadTimeData.getString('add'); |
| 46 this.$.actionButton.disabled = true; | 46 this.$.actionButton.disabled = true; |
| 47 } | 47 } |
| 48 this.$.dialog.showModal(); | 48 this.$.dialog.showModal(); |
| 49 }, | 49 }, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 76 this.onActionButtonTap_(); | 76 this.onActionButtonTap_(); |
| 77 }, | 77 }, |
| 78 | 78 |
| 79 /** @private */ | 79 /** @private */ |
| 80 validate_: function() { | 80 validate_: function() { |
| 81 this.browserProxy_.validateStartupPage(this.url_).then(function(isValid) { | 81 this.browserProxy_.validateStartupPage(this.url_).then(function(isValid) { |
| 82 this.$.actionButton.disabled = !isValid; | 82 this.$.actionButton.disabled = !isValid; |
| 83 }.bind(this)); | 83 }.bind(this)); |
| 84 }, | 84 }, |
| 85 }); | 85 }); |
| OLD | NEW |