Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 11198065: Add fourth batch of controlled setting indicators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 // Internet connection section (ChromeOS only). 104 // Internet connection section (ChromeOS only).
105 if (cr.isChromeOS) { 105 if (cr.isChromeOS) {
106 options.network.NetworkList.decorate($('network-list')); 106 options.network.NetworkList.decorate($('network-list'));
107 options.network.NetworkList.refreshNetworkData( 107 options.network.NetworkList.refreshNetworkData(
108 loadTimeData.getValue('networkData')); 108 loadTimeData.getValue('networkData'));
109 } 109 }
110 110
111 // On Startup section. 111 // On Startup section.
112 Preferences.getInstance().addEventListener('session.restore_on_startup', 112 Preferences.getInstance().addEventListener('session.restore_on_startup',
113 this.onRestoreOnStartupChanged_.bind(this)); 113 this.onRestoreOnStartupChanged_.bind(this));
114 Preferences.getInstance().addEventListener(
115 'session.urls_to_restore_on_startup',
116 function(event) {
117 $('startup-set-pages').disabled = event.value.disabled;
118 });
114 119
115 $('startup-set-pages').onclick = function() { 120 $('startup-set-pages').onclick = function() {
116 OptionsPage.navigateToPage('startup'); 121 OptionsPage.navigateToPage('startup');
117 }; 122 };
118 123
119 // Appearance section. 124 // Appearance section.
120 Preferences.getInstance().addEventListener('browser.show_home_button', 125 Preferences.getInstance().addEventListener('browser.show_home_button',
121 this.onShowHomeButtonChanged_.bind(this)); 126 this.onShowHomeButtonChanged_.bind(this));
122 127
123 Preferences.getInstance().addEventListener('homepage', 128 Preferences.getInstance().addEventListener('homepage',
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 didShowPage: function() { 465 didShowPage: function() {
461 $('search-field').focus(); 466 $('search-field').focus();
462 }, 467 },
463 468
464 /** 469 /**
465 * Event listener for the 'session.restore_on_startup' pref. 470 * Event listener for the 'session.restore_on_startup' pref.
466 * @param {Event} event The preference change event. 471 * @param {Event} event The preference change event.
467 * @private 472 * @private
468 */ 473 */
469 onRestoreOnStartupChanged_: function(event) { 474 onRestoreOnStartupChanged_: function(event) {
470 /** @const */ var showPagesValue = Number($('startup-show-pages').value);
471 /** @const */ var showHomePageValue = 0; 475 /** @const */ var showHomePageValue = 0;
472 476
473 $('startup-set-pages').disabled = event.value.disabled &&
474 event.value.value != showPagesValue;
475
476 if (event.value.value == showHomePageValue) { 477 if (event.value.value == showHomePageValue) {
477 // If the user previously selected "Show the homepage", the 478 // If the user previously selected "Show the homepage", the
478 // preference will already be migrated to "Open a specific page". So 479 // preference will already be migrated to "Open a specific page". So
479 // the only way to reach this code is if the 'restore on startup' 480 // the only way to reach this code is if the 'restore on startup'
480 // preference is managed. 481 // preference is managed.
481 assert(event.value.controlledBy); 482 assert(event.value.controlledBy);
482 483
483 // Select "open the following pages" and lock down the list of URLs 484 // Select "open the following pages" and lock down the list of URLs
484 // to reflect the intention of the policy. 485 // to reflect the intention of the policy.
485 $('startup-show-pages').checked = true; 486 $('startup-show-pages').checked = true;
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 BrowserOptions.getLoggedInUsername = function() { 1345 BrowserOptions.getLoggedInUsername = function() {
1345 return BrowserOptions.getInstance().username_; 1346 return BrowserOptions.getInstance().username_;
1346 }; 1347 };
1347 } 1348 }
1348 1349
1349 // Export 1350 // Export
1350 return { 1351 return {
1351 BrowserOptions: BrowserOptions 1352 BrowserOptions: BrowserOptions
1352 }; 1353 };
1353 }); 1354 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698