| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 var focusElement = $('advanced-settings-container').querySelector( | 70 var focusElement = $('advanced-settings-container').querySelector( |
| 71 'button, input, list, select, a[href]'); | 71 'button, input, list, select, a[href]'); |
| 72 if (focusElement) | 72 if (focusElement) |
| 73 focusElement.focus(); | 73 focusElement.focus(); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 $('advanced-settings').addEventListener('webkitTransitionEnd', | 77 $('advanced-settings').addEventListener('webkitTransitionEnd', |
| 78 this.updateAdvancedSettingsExpander_.bind(this)); | 78 this.updateAdvancedSettingsExpander_.bind(this)); |
| 79 | 79 |
| 80 if (cr.isChromeOS) | 80 if (cr.isChromeOS) { |
| 81 UIAccountTweaks.applyGuestModeVisibility(document); | 81 UIAccountTweaks.applyGuestModeVisibility(document); |
| 82 if (loadTimeData.getBoolean('secondaryUser')) |
| 83 $('secondary-user-banner').hidden = false; |
| 84 } |
| 82 | 85 |
| 83 // Sync (Sign in) section. | 86 // Sync (Sign in) section. |
| 84 this.updateSyncState_(loadTimeData.getValue('syncData')); | 87 this.updateSyncState_(loadTimeData.getValue('syncData')); |
| 85 | 88 |
| 86 $('start-stop-sync').onclick = function(event) { | 89 $('start-stop-sync').onclick = function(event) { |
| 87 if (self.signedIn_) | 90 if (self.signedIn_) |
| 88 SyncSetupOverlay.showStopSyncingUI(); | 91 SyncSetupOverlay.showStopSyncingUI(); |
| 89 else if (cr.isChromeOS) | 92 else if (cr.isChromeOS) |
| 90 SyncSetupOverlay.showSetupUI(); | 93 SyncSetupOverlay.showSetupUI(); |
| 91 else | 94 else |
| 92 SyncSetupOverlay.startSignIn(); | 95 SyncSetupOverlay.startSignIn(); |
| 93 }; | 96 }; |
| 94 $('customize-sync').onclick = function(event) { | 97 $('customize-sync').onclick = function(event) { |
| 95 SyncSetupOverlay.showSetupUI(); | 98 SyncSetupOverlay.showSetupUI(); |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 // Internet connection section (ChromeOS only). | 101 // Internet connection section (ChromeOS only). |
| 99 if (cr.isChromeOS) { | 102 if (cr.isChromeOS) { |
| 100 options.network.NetworkList.decorate($('network-list')); | 103 options.network.NetworkList.decorate($('network-list')); |
| 104 // Show that the network settings are shared if this is a secondary user |
| 105 // in a multi-profile session. |
| 106 if (loadTimeData.getBoolean('secondaryUser')) { |
| 107 var networkIndicator = document.querySelector( |
| 108 '#network-section-header > .controlled-setting-indicator'); |
| 109 networkIndicator.setAttribute('controlled-by', 'shared'); |
| 110 networkIndicator.location = cr.ui.ArrowLocation.TOP_START; |
| 111 } |
| 101 options.network.NetworkList.refreshNetworkData( | 112 options.network.NetworkList.refreshNetworkData( |
| 102 loadTimeData.getValue('networkData')); | 113 loadTimeData.getValue('networkData')); |
| 103 } | 114 } |
| 104 | 115 |
| 105 // On Startup section. | 116 // On Startup section. |
| 106 Preferences.getInstance().addEventListener('session.restore_on_startup', | 117 Preferences.getInstance().addEventListener('session.restore_on_startup', |
| 107 this.onRestoreOnStartupChanged_.bind(this)); | 118 this.onRestoreOnStartupChanged_.bind(this)); |
| 108 Preferences.getInstance().addEventListener( | 119 Preferences.getInstance().addEventListener( |
| 109 'session.startup_urls', | 120 'session.startup_urls', |
| 110 function(event) { | 121 function(event) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 this.updateAccountPicture_(); | 234 this.updateAccountPicture_(); |
| 224 | 235 |
| 225 $('account-picture').onclick = this.showImagerPickerOverlay_; | 236 $('account-picture').onclick = this.showImagerPickerOverlay_; |
| 226 $('change-picture-caption').onclick = this.showImagerPickerOverlay_; | 237 $('change-picture-caption').onclick = this.showImagerPickerOverlay_; |
| 227 | 238 |
| 228 $('manage-accounts-button').onclick = function(event) { | 239 $('manage-accounts-button').onclick = function(event) { |
| 229 OptionsPage.navigateToPage('accounts'); | 240 OptionsPage.navigateToPage('accounts'); |
| 230 chrome.send('coreOptionsUserMetricsAction', | 241 chrome.send('coreOptionsUserMetricsAction', |
| 231 ['Options_ManageAccounts']); | 242 ['Options_ManageAccounts']); |
| 232 }; | 243 }; |
| 244 |
| 245 document.querySelector( |
| 246 '#enable-screen-lock + span > .controlled-setting-indicator'). |
| 247 setAttribute('textshared', |
| 248 loadTimeData.getString('screenLockShared')); |
| 233 } else { | 249 } else { |
| 234 $('import-data').onclick = function(event) { | 250 $('import-data').onclick = function(event) { |
| 235 ImportDataOverlay.show(); | 251 ImportDataOverlay.show(); |
| 236 chrome.send('coreOptionsUserMetricsAction', ['Import_ShowDlg']); | 252 chrome.send('coreOptionsUserMetricsAction', ['Import_ShowDlg']); |
| 237 }; | 253 }; |
| 238 | 254 |
| 239 if ($('themes-native-button')) { | 255 if ($('themes-native-button')) { |
| 240 $('themes-native-button').onclick = function(event) { | 256 $('themes-native-button').onclick = function(event) { |
| 241 chrome.send('themesSetNative'); | 257 chrome.send('themesSetNative'); |
| 242 }; | 258 }; |
| (...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1609 BrowserOptions.getLoggedInUsername = function() { | 1625 BrowserOptions.getLoggedInUsername = function() { |
| 1610 return BrowserOptions.getInstance().username_; | 1626 return BrowserOptions.getInstance().username_; |
| 1611 }; | 1627 }; |
| 1612 } | 1628 } |
| 1613 | 1629 |
| 1614 // Export | 1630 // Export |
| 1615 return { | 1631 return { |
| 1616 BrowserOptions: BrowserOptions | 1632 BrowserOptions: BrowserOptions |
| 1617 }; | 1633 }; |
| 1618 }); | 1634 }); |
| OLD | NEW |