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