| 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 | 6 * @fileoverview |
| 7 * 'cr-settings-on-startup-page' is a settings page. | 7 * 'cr-settings-on-startup-page' is a settings page. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 prefValue: { | 79 prefValue: { |
| 80 type: Number, | 80 type: Number, |
| 81 } | 81 } |
| 82 }, | 82 }, |
| 83 | 83 |
| 84 observers: [ | 84 observers: [ |
| 85 'prefValueChanged(prefValue)', | 85 'prefValueChanged(prefValue)', |
| 86 ], | 86 ], |
| 87 | 87 |
| 88 /** @override */ |
| 88 attached: function() { | 89 attached: function() { |
| 89 this.prefValue = this.prefs.session.restore_on_startup.value; | 90 var restoreOnStartup = |
| 90 }, | 91 this.get('session.restore_on_startup.value', this.prefs); |
| 91 | 92 if (restoreOnStartup != undefined) |
| 92 prefValueChanged: function(prefValue) { | 93 this.prefValue = /** @type {number} */(restoreOnStartup); |
| 93 this.set('prefs.session.restore_on_startup.value', parseInt(prefValue)); | |
| 94 }, | 94 }, |
| 95 | 95 |
| 96 /** @private */ | 96 /** @private */ |
| 97 prefValueChanged: function(prefValue) { |
| 98 this.set('prefs.session.restore_on_startup.value', parseInt(prefValue, 10)); |
| 99 }, |
| 100 |
| 101 /** @private */ |
| 97 onBackTap_: function() { | 102 onBackTap_: function() { |
| 98 this.$.pages.back(); | 103 this.$.pages.back(); |
| 99 }, | 104 }, |
| 100 | 105 |
| 101 /** @private */ | 106 /** @private */ |
| 102 onSetPagesTap_: function() { | 107 onSetPagesTap_: function() { |
| 103 this.$.pages.navigateTo('startup-urls'); | 108 this.$.pages.setSubpageChain(['startup-urls']); |
| 104 }, | 109 }, |
| 105 }); | 110 }); |
| OLD | NEW |