OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview 'settings-startup-url-dialog' is a component for adding |
| 7 * or editing a startup URL entry. |
| 8 */ |
| 9 Polymer({ |
| 10 is: 'settings-startup-url-dialog', |
| 11 |
| 12 properties: { |
| 13 /** @private {string} */ |
| 14 url_: String, |
| 15 }, |
| 16 |
| 17 /** @private {!settings.SearchEnginesBrowserProxy} */ |
| 18 browserProxy_: null, |
| 19 |
| 20 /** @override */ |
| 21 ready: function() { |
| 22 this.browserProxy_ = settings.StartupUrlsPageBrowserProxyImpl.getInstance(); |
| 23 this.$.add.disabled = true; |
| 24 }, |
| 25 |
| 26 /** @override */ |
| 27 attached: function() { |
| 28 this.$.dialog.open(); |
| 29 }, |
| 30 |
| 31 /** @private */ |
| 32 onCancelTap_: function() { |
| 33 this.$.dialog.close(); |
| 34 }, |
| 35 |
| 36 /** @private */ |
| 37 onAddTap_: function() { |
| 38 this.browserProxy_.addStartupPage(this.url_); |
| 39 this.$.dialog.close(); |
| 40 }, |
| 41 |
| 42 /** @private */ |
| 43 validate_: function() { |
| 44 this.browserProxy_.validateStartupPage(this.url_).then(function(isValid) { |
| 45 this.$.add.disabled = !isValid; |
| 46 }.bind(this)); |
| 47 }, |
| 48 }); |
OLD | NEW |