OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
7 const ArrayDataModel = cr.ui.ArrayDataModel; | 7 const ArrayDataModel = cr.ui.ArrayDataModel; |
8 | 8 |
9 // | 9 // |
10 // BrowserOptions class | 10 // BrowserOptions class |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 }, | 240 }, |
241 | 241 |
242 /** | 242 /** |
243 * Returns true if the custom startup page control block should | 243 * Returns true if the custom startup page control block should |
244 * be enabled. | 244 * be enabled. |
245 * @returns {boolean} Whether the startup page controls should be | 245 * @returns {boolean} Whether the startup page controls should be |
246 * enabled. | 246 * enabled. |
247 */ | 247 */ |
248 shouldEnableCustomStartupPageControls: function(pages) { | 248 shouldEnableCustomStartupPageControls: function(pages) { |
249 return $('startupShowPagesButton').checked && | 249 return $('startupShowPagesButton').checked && |
250 !this.startup_pages_pref_.controlledBy; | 250 (this.startup_pages_pref_.controlledBy == 'recommended' || |
251 !this.startup_pages_pref_.controlledBy) && | |
252 !this.startup_pages_pref_.disabled; | |
Joao da Silva
2011/12/10 14:53:30
Remove the "controlledBy" lines. It suffices to do
NaveenBobbili (Motorola)
2011/12/10 17:36:15
Done.
| |
251 }, | 253 }, |
252 | 254 |
253 /** | 255 /** |
254 * Updates the startup pages list with the given entries. | 256 * Updates the startup pages list with the given entries. |
255 * @param {Array} pages List of startup pages. | 257 * @param {Array} pages List of startup pages. |
256 * @private | 258 * @private |
257 */ | 259 */ |
258 updateStartupPages_: function(pages) { | 260 updateStartupPages_: function(pages) { |
259 var model = new ArrayDataModel(pages); | 261 var model = new ArrayDataModel(pages); |
260 // Add a "new page" row. | 262 // Add a "new page" row. |
(...skipping 19 matching lines...) Expand all Loading... | |
280 $('startupUseCurrentButton').disabled = disable; | 282 $('startupUseCurrentButton').disabled = disable; |
281 }, | 283 }, |
282 | 284 |
283 /** | 285 /** |
284 * Handle change events of the preference | 286 * Handle change events of the preference |
285 * 'session.urls_to_restore_on_startup'. | 287 * 'session.urls_to_restore_on_startup'. |
286 * @param {event} preference changed event. | 288 * @param {event} preference changed event. |
287 * @private | 289 * @private |
288 */ | 290 */ |
289 handleStartupPageListChange_: function(event) { | 291 handleStartupPageListChange_: function(event) { |
290 this.startup_pages_pref_.controlledBy = event.value['controlledBy']; | 292 this.startup_pages_pref_.controlledBy = event.value['controlledBy']; |
Joao da Silva
2011/12/10 14:53:30
Remove the ".controlledBy" line, it's not needed.
NaveenBobbili (Motorola)
2011/12/10 17:36:15
Done.
| |
293 this.startup_pages_pref_.disabled = event.value['disabled']; | |
291 this.updateCustomStartupPageControlStates_(); | 294 this.updateCustomStartupPageControlStates_(); |
292 }, | 295 }, |
293 | 296 |
294 /** | 297 /** |
295 * Set the default search engine based on the popup selection. | 298 * Set the default search engine based on the popup selection. |
296 */ | 299 */ |
297 setDefaultSearchEngine_: function() { | 300 setDefaultSearchEngine_: function() { |
298 var engineSelect = $('defaultSearchEngine'); | 301 var engineSelect = $('defaultSearchEngine'); |
299 var selectedIndex = engineSelect.selectedIndex; | 302 var selectedIndex = engineSelect.selectedIndex; |
300 if (selectedIndex >= 0) { | 303 if (selectedIndex >= 0) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 BrowserOptions.setInstantFieldTrialStatus = function(enabled) { | 359 BrowserOptions.setInstantFieldTrialStatus = function(enabled) { |
357 BrowserOptions.getInstance().setInstantFieldTrialStatus_(enabled); | 360 BrowserOptions.getInstance().setInstantFieldTrialStatus_(enabled); |
358 }; | 361 }; |
359 | 362 |
360 // Export | 363 // Export |
361 return { | 364 return { |
362 BrowserOptions: BrowserOptions | 365 BrowserOptions: BrowserOptions |
363 }; | 366 }; |
364 | 367 |
365 }); | 368 }); |
OLD | NEW |