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 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
7 /** @const */ var SettingsDialog = options.SettingsDialog; | 7 /** @const */ var SettingsDialog = options.SettingsDialog; |
8 | 8 |
9 /** | 9 /** |
10 * StartupOverlay class | 10 * StartupOverlay class |
11 * Encapsulated handling of the 'Set Startup pages' overlay page. | 11 * Encapsulated handling of the 'Set Startup pages' overlay page. |
12 * @constructor | 12 * @constructor |
13 * @class | 13 * @extends {options.SettingsDialog} |
14 */ | 14 */ |
15 function StartupOverlay() { | 15 function StartupOverlay() { |
16 SettingsDialog.call(this, 'startup', | 16 SettingsDialog.call(this, 'startup', |
17 loadTimeData.getString('startupPagesOverlayTabTitle'), | 17 loadTimeData.getString('startupPagesOverlayTabTitle'), |
18 'startup-overlay', | 18 'startup-overlay', |
19 $('startup-overlay-confirm'), | 19 $('startup-overlay-confirm'), |
20 $('startup-overlay-cancel')); | 20 $('startup-overlay-cancel')); |
21 }; | 21 }; |
22 | 22 |
23 cr.addSingletonGetter(StartupOverlay); | 23 cr.addSingletonGetter(StartupOverlay); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 * based on the whether the 'pages to restore on startup' pref is enabled. | 99 * based on the whether the 'pages to restore on startup' pref is enabled. |
100 */ | 100 */ |
101 updateControlStates: function() { | 101 updateControlStates: function() { |
102 this.setControlsDisabled( | 102 this.setControlsDisabled( |
103 this.startup_pages_pref_.disabled); | 103 this.startup_pages_pref_.disabled); |
104 }, | 104 }, |
105 | 105 |
106 /** | 106 /** |
107 * Handles change events of the preference | 107 * Handles change events of the preference |
108 * 'session.startup_urls'. | 108 * 'session.startup_urls'. |
109 * @param {event} event Preference changed event. | 109 * @param {Event} event Preference changed event. |
110 * @private | 110 * @private |
111 */ | 111 */ |
112 handleStartupPageListChange_: function(event) { | 112 handleStartupPageListChange_: function(event) { |
113 this.startup_pages_pref_.disabled = event.value.disabled; | 113 this.startup_pages_pref_.disabled = event.value.disabled; |
114 this.updateControlStates(); | 114 this.updateControlStates(); |
115 }, | 115 }, |
116 | 116 |
117 /** | 117 /** |
118 * Updates the startup pages list with the given entries. | 118 * Updates the startup pages list with the given entries. |
119 * @param {Array} pages List of startup pages. | 119 * @param {Array} pages List of startup pages. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 var instance = StartupOverlay.getInstance(); | 163 var instance = StartupOverlay.getInstance(); |
164 return instance[name + '_'].apply(instance, arguments); | 164 return instance[name + '_'].apply(instance, arguments); |
165 }; | 165 }; |
166 }); | 166 }); |
167 | 167 |
168 // Export | 168 // Export |
169 return { | 169 return { |
170 StartupOverlay: StartupOverlay | 170 StartupOverlay: StartupOverlay |
171 }; | 171 }; |
172 }); | 172 }); |
OLD | NEW |