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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 !loadTimeData.getBoolean('multiple_profiles'); | 376 !loadTimeData.getBoolean('multiple_profiles'); |
377 } | 377 } |
378 | 378 |
379 // Network section. | 379 // Network section. |
380 if (!cr.isChromeOS) { | 380 if (!cr.isChromeOS) { |
381 $('proxiesConfigureButton').onclick = function(event) { | 381 $('proxiesConfigureButton').onclick = function(event) { |
382 chrome.send('showNetworkProxySettings'); | 382 chrome.send('showNetworkProxySettings'); |
383 }; | 383 }; |
384 } | 384 } |
385 | 385 |
| 386 // Easy Unlock section. |
| 387 if (loadTimeData.getBoolean('easyUnlockEnabled')) { |
| 388 $('easy-unlock-section').hidden = false; |
| 389 $('easy-unlock-setup-button').onclick = function(event) { |
| 390 chrome.send('launchEasyUnlockSetup'); |
| 391 }; |
| 392 } |
| 393 |
386 // Web Content section. | 394 // Web Content section. |
387 $('fontSettingsCustomizeFontsButton').onclick = function(event) { | 395 $('fontSettingsCustomizeFontsButton').onclick = function(event) { |
388 OptionsPage.navigateToPage('fonts'); | 396 OptionsPage.navigateToPage('fonts'); |
389 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); | 397 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); |
390 }; | 398 }; |
391 $('defaultFontSize').onchange = function(event) { | 399 $('defaultFontSize').onchange = function(event) { |
392 var value = event.target.options[event.target.selectedIndex].value; | 400 var value = event.target.options[event.target.selectedIndex].value; |
393 Preferences.setIntegerPref( | 401 Preferences.setIntegerPref( |
394 'webkit.webprefs.default_fixed_font_size', | 402 'webkit.webprefs.default_fixed_font_size', |
395 value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, true); | 403 value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, true); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 | 902 |
895 // Move #enable-auto-login-checkbox to a different location on CrOS. | 903 // Move #enable-auto-login-checkbox to a different location on CrOS. |
896 if (cr.isChromeOs) { | 904 if (cr.isChromeOs) { |
897 $('sync-general').insertBefore($('sync-status').nextSibling, | 905 $('sync-general').insertBefore($('sync-status').nextSibling, |
898 $('enable-auto-login-checkbox')); | 906 $('enable-auto-login-checkbox')); |
899 } | 907 } |
900 $('enable-auto-login-checkbox').hidden = !syncData.autoLoginVisible; | 908 $('enable-auto-login-checkbox').hidden = !syncData.autoLoginVisible; |
901 }, | 909 }, |
902 | 910 |
903 /** | 911 /** |
| 912 * Update the UI depending on whether the current profile has a pairing for |
| 913 * Easy Unlock. |
| 914 * @param {boolean} hasPairing True if the current profile has a pairing. |
| 915 */ |
| 916 updateEasyUnlock_: function(hasPairing) { |
| 917 $('easy-unlock-setup').hidden = hasPairing; |
| 918 $('easy-unlock-enable').hidden = !hasPairing; |
| 919 }, |
| 920 |
| 921 /** |
904 * Update the UI depending on whether the current profile manages any | 922 * Update the UI depending on whether the current profile manages any |
905 * supervised users. | 923 * supervised users. |
906 * @param {boolean} value True if the current profile manages any supervised | 924 * @param {boolean} value True if the current profile manages any supervised |
907 * users. | 925 * users. |
908 */ | 926 */ |
909 updateManagesSupervisedUsers_: function(value) { | 927 updateManagesSupervisedUsers_: function(value) { |
910 if (value) { | 928 if (value) { |
911 $('profiles-supervised-dashboard-tip').hidden = false; | 929 $('profiles-supervised-dashboard-tip').hidden = false; |
912 } else { | 930 } else { |
913 $('profiles-supervised-dashboard-tip').hidden = true; | 931 $('profiles-supervised-dashboard-tip').hidden = true; |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 'showCreateProfileSuccess', | 1671 'showCreateProfileSuccess', |
1654 'showCreateProfileWarning', | 1672 'showCreateProfileWarning', |
1655 'showHotwordSection', | 1673 'showHotwordSection', |
1656 'showManagedUserImportError', | 1674 'showManagedUserImportError', |
1657 'showManagedUserImportSuccess', | 1675 'showManagedUserImportSuccess', |
1658 'showMouseControls', | 1676 'showMouseControls', |
1659 'showTouchpadControls', | 1677 'showTouchpadControls', |
1660 'updateAccountPicture', | 1678 'updateAccountPicture', |
1661 'updateAutoLaunchState', | 1679 'updateAutoLaunchState', |
1662 'updateDefaultBrowserState', | 1680 'updateDefaultBrowserState', |
| 1681 'updateEasyUnlock', |
1663 'updateManagesSupervisedUsers', | 1682 'updateManagesSupervisedUsers', |
1664 'updateSearchEngines', | 1683 'updateSearchEngines', |
1665 'updateStartupPages', | 1684 'updateStartupPages', |
1666 'updateSyncState', | 1685 'updateSyncState', |
1667 ].forEach(function(name) { | 1686 ].forEach(function(name) { |
1668 BrowserOptions[name] = function() { | 1687 BrowserOptions[name] = function() { |
1669 var instance = BrowserOptions.getInstance(); | 1688 var instance = BrowserOptions.getInstance(); |
1670 return instance[name + '_'].apply(instance, arguments); | 1689 return instance[name + '_'].apply(instance, arguments); |
1671 }; | 1690 }; |
1672 }); | 1691 }); |
1673 | 1692 |
1674 if (cr.isChromeOS) { | 1693 if (cr.isChromeOS) { |
1675 /** | 1694 /** |
1676 * Returns username (canonical email) of the user logged in (ChromeOS only). | 1695 * Returns username (canonical email) of the user logged in (ChromeOS only). |
1677 * @return {string} user email. | 1696 * @return {string} user email. |
1678 */ | 1697 */ |
1679 // TODO(jhawkins): Investigate the use case for this method. | 1698 // TODO(jhawkins): Investigate the use case for this method. |
1680 BrowserOptions.getLoggedInUsername = function() { | 1699 BrowserOptions.getLoggedInUsername = function() { |
1681 return BrowserOptions.getInstance().username_; | 1700 return BrowserOptions.getInstance().username_; |
1682 }; | 1701 }; |
1683 } | 1702 } |
1684 | 1703 |
1685 // Export | 1704 // Export |
1686 return { | 1705 return { |
1687 BrowserOptions: BrowserOptions | 1706 BrowserOptions: BrowserOptions |
1688 }; | 1707 }; |
1689 }); | 1708 }); |
OLD | NEW |