| 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 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; | 9 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; |
| 10 | 10 |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 !loadTimeData.getBoolean('multiple_profiles'); | 389 !loadTimeData.getBoolean('multiple_profiles'); |
| 390 } | 390 } |
| 391 | 391 |
| 392 // Network section. | 392 // Network section. |
| 393 if (!cr.isChromeOS) { | 393 if (!cr.isChromeOS) { |
| 394 $('proxiesConfigureButton').onclick = function(event) { | 394 $('proxiesConfigureButton').onclick = function(event) { |
| 395 chrome.send('showNetworkProxySettings'); | 395 chrome.send('showNetworkProxySettings'); |
| 396 }; | 396 }; |
| 397 } | 397 } |
| 398 | 398 |
| 399 // Easy Unlock section. |
| 400 if (loadTimeData.getBoolean('easyUnlockEnabled')) { |
| 401 $('easy-unlock-section').hidden = false; |
| 402 $('easy-unlock-setup-button').onclick = function(event) { |
| 403 chrome.send('launchEasyUnlockSetup'); |
| 404 }; |
| 405 } |
| 406 |
| 399 // Web Content section. | 407 // Web Content section. |
| 400 $('fontSettingsCustomizeFontsButton').onclick = function(event) { | 408 $('fontSettingsCustomizeFontsButton').onclick = function(event) { |
| 401 OptionsPage.navigateToPage('fonts'); | 409 OptionsPage.navigateToPage('fonts'); |
| 402 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); | 410 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); |
| 403 }; | 411 }; |
| 404 $('defaultFontSize').onchange = function(event) { | 412 $('defaultFontSize').onchange = function(event) { |
| 405 var value = event.target.options[event.target.selectedIndex].value; | 413 var value = event.target.options[event.target.selectedIndex].value; |
| 406 Preferences.setIntegerPref( | 414 Preferences.setIntegerPref( |
| 407 'webkit.webprefs.default_fixed_font_size', | 415 'webkit.webprefs.default_fixed_font_size', |
| 408 value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, true); | 416 value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, true); |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 | 912 |
| 905 // Move #enable-auto-login-checkbox to a different location on CrOS. | 913 // Move #enable-auto-login-checkbox to a different location on CrOS. |
| 906 if (cr.isChromeOs) { | 914 if (cr.isChromeOs) { |
| 907 $('sync-general').insertBefore($('sync-status').nextSibling, | 915 $('sync-general').insertBefore($('sync-status').nextSibling, |
| 908 $('enable-auto-login-checkbox')); | 916 $('enable-auto-login-checkbox')); |
| 909 } | 917 } |
| 910 $('enable-auto-login-checkbox').hidden = !syncData.autoLoginVisible; | 918 $('enable-auto-login-checkbox').hidden = !syncData.autoLoginVisible; |
| 911 }, | 919 }, |
| 912 | 920 |
| 913 /** | 921 /** |
| 922 * Update the UI depending on whether the current profile has a pairing for |
| 923 * Easy Unlock. |
| 924 * @param {boolean} hasPairing True if the current profile has a pairing. |
| 925 */ |
| 926 updateEasyUnlock_: function(hasPairing) { |
| 927 $('easy-unlock-setup').hidden = hasPairing; |
| 928 $('easy-unlock-enable').hidden = !hasPairing; |
| 929 }, |
| 930 |
| 931 /** |
| 914 * Update the UI depending on whether the current profile manages any | 932 * Update the UI depending on whether the current profile manages any |
| 915 * supervised users. | 933 * supervised users. |
| 916 * @param {boolean} show True if the current profile manages any supervised | 934 * @param {boolean} show True if the current profile manages any supervised |
| 917 * users. | 935 * users. |
| 918 */ | 936 */ |
| 919 updateManagesSupervisedUsers_: function(show) { | 937 updateManagesSupervisedUsers_: function(show) { |
| 920 $('profiles-supervised-dashboard-tip').hidden = !show; | 938 $('profiles-supervised-dashboard-tip').hidden = !show; |
| 921 this.maybeShowUserSection_(); | 939 this.maybeShowUserSection_(); |
| 922 }, | 940 }, |
| 923 | 941 |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 'showCreateProfileSuccess', | 1702 'showCreateProfileSuccess', |
| 1685 'showCreateProfileWarning', | 1703 'showCreateProfileWarning', |
| 1686 'showHotwordSection', | 1704 'showHotwordSection', |
| 1687 'showManagedUserImportError', | 1705 'showManagedUserImportError', |
| 1688 'showManagedUserImportSuccess', | 1706 'showManagedUserImportSuccess', |
| 1689 'showMouseControls', | 1707 'showMouseControls', |
| 1690 'showTouchpadControls', | 1708 'showTouchpadControls', |
| 1691 'updateAccountPicture', | 1709 'updateAccountPicture', |
| 1692 'updateAutoLaunchState', | 1710 'updateAutoLaunchState', |
| 1693 'updateDefaultBrowserState', | 1711 'updateDefaultBrowserState', |
| 1712 'updateEasyUnlock', |
| 1694 'updateManagesSupervisedUsers', | 1713 'updateManagesSupervisedUsers', |
| 1695 'updateSearchEngines', | 1714 'updateSearchEngines', |
| 1696 'updateStartupPages', | 1715 'updateStartupPages', |
| 1697 'updateSyncState', | 1716 'updateSyncState', |
| 1698 ].forEach(function(name) { | 1717 ].forEach(function(name) { |
| 1699 BrowserOptions[name] = function() { | 1718 BrowserOptions[name] = function() { |
| 1700 var instance = BrowserOptions.getInstance(); | 1719 var instance = BrowserOptions.getInstance(); |
| 1701 return instance[name + '_'].apply(instance, arguments); | 1720 return instance[name + '_'].apply(instance, arguments); |
| 1702 }; | 1721 }; |
| 1703 }); | 1722 }); |
| 1704 | 1723 |
| 1705 if (cr.isChromeOS) { | 1724 if (cr.isChromeOS) { |
| 1706 /** | 1725 /** |
| 1707 * Returns username (canonical email) of the user logged in (ChromeOS only). | 1726 * Returns username (canonical email) of the user logged in (ChromeOS only). |
| 1708 * @return {string} user email. | 1727 * @return {string} user email. |
| 1709 */ | 1728 */ |
| 1710 // TODO(jhawkins): Investigate the use case for this method. | 1729 // TODO(jhawkins): Investigate the use case for this method. |
| 1711 BrowserOptions.getLoggedInUsername = function() { | 1730 BrowserOptions.getLoggedInUsername = function() { |
| 1712 return BrowserOptions.getInstance().username_; | 1731 return BrowserOptions.getInstance().username_; |
| 1713 }; | 1732 }; |
| 1714 } | 1733 } |
| 1715 | 1734 |
| 1716 // Export | 1735 // Export |
| 1717 return { | 1736 return { |
| 1718 BrowserOptions: BrowserOptions | 1737 BrowserOptions: BrowserOptions |
| 1719 }; | 1738 }; |
| 1720 }); | 1739 }); |
| OLD | NEW |