OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 | 9 |
10 // | 10 // |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 // On Startup section. | 101 // On Startup section. |
102 Preferences.getInstance().addEventListener('session.restore_on_startup', | 102 Preferences.getInstance().addEventListener('session.restore_on_startup', |
103 this.onRestoreOnStartupChanged_.bind(this)); | 103 this.onRestoreOnStartupChanged_.bind(this)); |
104 | 104 |
105 $('startup-set-pages').onclick = function() { | 105 $('startup-set-pages').onclick = function() { |
106 OptionsPage.navigateToPage('startup'); | 106 OptionsPage.navigateToPage('startup'); |
107 }; | 107 }; |
108 | 108 |
109 // Session restore. | 109 // Session restore. |
| 110 // TODO(marja): clean up the options UI after the decision on the session |
| 111 // restore changes has stabilized. For now, only the startup option is |
| 112 // renamed to "continue where I left off", but the session related content |
| 113 // settings are not disabled or overridden (because |
| 114 // templateData.enable_restore_session_state is forced to false). |
110 this.sessionRestoreEnabled_ = templateData.enable_restore_session_state; | 115 this.sessionRestoreEnabled_ = templateData.enable_restore_session_state; |
111 if (this.sessionRestoreEnabled_) { | 116 if (this.sessionRestoreEnabled_) { |
112 $('old-startup-last-text').hidden = true; | |
113 $('new-startup-last-text').hidden = false; | |
114 $('startup-restore-session').onchange = function(event) { | 117 $('startup-restore-session').onchange = function(event) { |
115 if (!BrowserOptions.getInstance().maybeShowSessionRestoreDialog_()) { | 118 if (!BrowserOptions.getInstance().maybeShowSessionRestoreDialog_()) { |
116 // The dialog is not shown; handle the event normally. | 119 // The dialog is not shown; handle the event normally. |
117 event.currentTarget.savePrefState(); | 120 event.currentTarget.savePrefState(); |
118 } | 121 } |
119 }; | 122 }; |
120 } | 123 } |
121 | 124 |
122 // Appearance section. | 125 // Appearance section. |
123 Preferences.getInstance().addEventListener('browser.show_home_button', | 126 Preferences.getInstance().addEventListener('browser.show_home_button', |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 BrowserOptions.getLoggedInUsername = function() { | 1327 BrowserOptions.getLoggedInUsername = function() { |
1325 return BrowserOptions.getInstance().username_; | 1328 return BrowserOptions.getInstance().username_; |
1326 }; | 1329 }; |
1327 } | 1330 } |
1328 | 1331 |
1329 // Export | 1332 // Export |
1330 return { | 1333 return { |
1331 BrowserOptions: BrowserOptions | 1334 BrowserOptions: BrowserOptions |
1332 }; | 1335 }; |
1333 }); | 1336 }); |
OLD | NEW |