| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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-urls-page' is the settings page | 6 * @fileoverview 'settings-startup-urls-page' is the settings page |
| 7 * containing the urls that will be opened when chrome is started. | 7 * containing the urls that will be opened when chrome is started. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 Polymer({ | 10 Polymer({ |
| 11 is: 'settings-startup-urls-page', | 11 is: 'settings-startup-urls-page', |
| 12 | 12 |
| 13 behaviors: [WebUIListenerBehavior], | 13 behaviors: [CrScrollableBehavior, WebUIListenerBehavior], |
| 14 | 14 |
| 15 properties: { | 15 properties: { |
| 16 /** @type {settings.StartupUrlsPageBrowserProxy} */ | 16 /** @type {settings.StartupUrlsPageBrowserProxy} */ |
| 17 browserProxy_: Object, | 17 browserProxy_: Object, |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Pages to load upon browser startup. | 20 * Pages to load upon browser startup. |
| 21 * @private {!Array<!StartupPageInfo>} | 21 * @private {!Array<!StartupPageInfo>} |
| 22 */ | 22 */ |
| 23 startupPages_: Array, | 23 startupPages_: Array, |
| 24 | 24 |
| 25 /** @private */ | 25 /** @private */ |
| 26 showStartupUrlDialog_: Boolean, | 26 showStartupUrlDialog_: Boolean, |
| 27 | 27 |
| 28 /** @private {?StartupPageInfo} */ | 28 /** @private {?StartupPageInfo} */ |
| 29 startupUrlDialogModel_: Object, | 29 startupUrlDialogModel_: Object, |
| 30 }, | 30 }, |
| 31 | 31 |
| 32 /** @override */ | 32 /** @override */ |
| 33 attached: function() { | 33 attached: function() { |
| 34 this.browserProxy_ = settings.StartupUrlsPageBrowserProxyImpl.getInstance(); | 34 this.browserProxy_ = settings.StartupUrlsPageBrowserProxyImpl.getInstance(); |
| 35 this.addWebUIListener('update-startup-pages', function(startupPages) { | 35 this.addWebUIListener('update-startup-pages', function(startupPages) { |
| 36 this.startupPages_ = startupPages; | 36 this.startupPages_ = startupPages; |
| 37 this.updateScrollableContents(); |
| 37 }.bind(this)); | 38 }.bind(this)); |
| 38 this.browserProxy_.loadStartupPages(); | 39 this.browserProxy_.loadStartupPages(); |
| 39 | 40 |
| 40 this.addEventListener(settings.EDIT_STARTUP_URL_EVENT, function(event) { | 41 this.addEventListener(settings.EDIT_STARTUP_URL_EVENT, function(event) { |
| 41 this.startupUrlDialogModel_ = event.detail; | 42 this.startupUrlDialogModel_ = event.detail; |
| 42 this.openDialog_(); | 43 this.openDialog_(); |
| 43 event.stopPropagation(); | 44 event.stopPropagation(); |
| 44 }.bind(this)); | 45 }.bind(this)); |
| 45 }, | 46 }, |
| 46 | 47 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 64 this.startupUrlDialogModel_ = null; | 65 this.startupUrlDialogModel_ = null; |
| 65 }.bind(this)); | 66 }.bind(this)); |
| 66 }.bind(this)); | 67 }.bind(this)); |
| 67 }, | 68 }, |
| 68 | 69 |
| 69 /** @private */ | 70 /** @private */ |
| 70 onUseCurrentPagesTap_: function() { | 71 onUseCurrentPagesTap_: function() { |
| 71 this.browserProxy_.useCurrentPages(); | 72 this.browserProxy_.useCurrentPages(); |
| 72 }, | 73 }, |
| 73 }); | 74 }); |
| OLD | NEW |