| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 412 |
| 413 // Network section. | 413 // Network section. |
| 414 if (!cr.isChromeOS) { | 414 if (!cr.isChromeOS) { |
| 415 $('proxiesConfigureButton').onclick = function(event) { | 415 $('proxiesConfigureButton').onclick = function(event) { |
| 416 chrome.send('showNetworkProxySettings'); | 416 chrome.send('showNetworkProxySettings'); |
| 417 }; | 417 }; |
| 418 } | 418 } |
| 419 | 419 |
| 420 // Device control section. | 420 // Device control section. |
| 421 if (cr.isChromeOS && | 421 if (cr.isChromeOS && |
| 422 UIAccountTweaks.currentUserIsOwner() && |
| 422 loadTimeData.getBoolean('consumerManagementEnabled')) { | 423 loadTimeData.getBoolean('consumerManagementEnabled')) { |
| 423 $('device-control-section').hidden = false; | 424 $('device-control-section').hidden = false; |
| 424 | 425 |
| 426 var isEnrolled = loadTimeData.getBoolean('consumerManagementEnrolled'); |
| 427 $('consumer-management-enroll').hidden = isEnrolled; |
| 428 $('consumer-management-unenroll').hidden = !isEnrolled; |
| 429 |
| 425 $('consumer-management-section').onclick = function(event) { | 430 $('consumer-management-section').onclick = function(event) { |
| 426 // If either button is clicked. | 431 // If either button is clicked. |
| 427 if (event.target.tagName == 'BUTTON') | 432 if (event.target.tagName == 'BUTTON') |
| 428 OptionsPage.navigateToPage('consumer-management-overlay'); | 433 OptionsPage.navigateToPage('consumer-management-overlay'); |
| 429 }; | 434 }; |
| 430 } | 435 } |
| 431 | 436 |
| 432 // Easy Unlock section. | 437 // Easy Unlock section. |
| 433 if (loadTimeData.getBoolean('easyUnlockEnabled')) { | 438 if (loadTimeData.getBoolean('easyUnlockEnabled')) { |
| 434 $('easy-unlock-section').hidden = false; | 439 $('easy-unlock-section').hidden = false; |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1823 'getStartStopSyncButton', | 1828 'getStartStopSyncButton', |
| 1824 'hideBluetoothSettings', | 1829 'hideBluetoothSettings', |
| 1825 'notifyInitializationComplete', | 1830 'notifyInitializationComplete', |
| 1826 'removeBluetoothDevice', | 1831 'removeBluetoothDevice', |
| 1827 'scrollToSection', | 1832 'scrollToSection', |
| 1828 'setAccountPictureManaged', | 1833 'setAccountPictureManaged', |
| 1829 'setWallpaperManaged', | 1834 'setWallpaperManaged', |
| 1830 'setAutoOpenFileTypesDisplayed', | 1835 'setAutoOpenFileTypesDisplayed', |
| 1831 'setBluetoothState', | 1836 'setBluetoothState', |
| 1832 'setCanSetTime', | 1837 'setCanSetTime', |
| 1833 'setConsumerManagementEnrollmentStatus', | |
| 1834 'setFontSize', | 1838 'setFontSize', |
| 1835 'setNativeThemeButtonEnabled', | 1839 'setNativeThemeButtonEnabled', |
| 1836 'setHighContrastCheckboxState', | 1840 'setHighContrastCheckboxState', |
| 1837 'setMetricsReportingCheckboxState', | 1841 'setMetricsReportingCheckboxState', |
| 1838 'setMetricsReportingSettingVisibility', | 1842 'setMetricsReportingSettingVisibility', |
| 1839 'setProfilesInfo', | 1843 'setProfilesInfo', |
| 1840 'setSpokenFeedbackCheckboxState', | 1844 'setSpokenFeedbackCheckboxState', |
| 1841 'setThemesResetButtonEnabled', | 1845 'setThemesResetButtonEnabled', |
| 1842 'setVirtualKeyboardCheckboxState', | 1846 'setVirtualKeyboardCheckboxState', |
| 1843 'setupPageZoomSelector', | 1847 'setupPageZoomSelector', |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1869 | 1873 |
| 1870 if (cr.isChromeOS) { | 1874 if (cr.isChromeOS) { |
| 1871 /** | 1875 /** |
| 1872 * Returns username (canonical email) of the user logged in (ChromeOS only). | 1876 * Returns username (canonical email) of the user logged in (ChromeOS only). |
| 1873 * @return {string} user email. | 1877 * @return {string} user email. |
| 1874 */ | 1878 */ |
| 1875 // TODO(jhawkins): Investigate the use case for this method. | 1879 // TODO(jhawkins): Investigate the use case for this method. |
| 1876 BrowserOptions.getLoggedInUsername = function() { | 1880 BrowserOptions.getLoggedInUsername = function() { |
| 1877 return BrowserOptions.getInstance().username_; | 1881 return BrowserOptions.getInstance().username_; |
| 1878 }; | 1882 }; |
| 1879 | |
| 1880 /** | |
| 1881 * Shows enroll or unenroll button based on the enrollment status. | |
| 1882 * @param {boolean} isEnrolled Whether the device is enrolled. | |
| 1883 */ | |
| 1884 BrowserOptions.setConsumerManagementEnrollmentStatus = | |
| 1885 function(isEnrolled) { | |
| 1886 $('consumer-management-enroll').hidden = isEnrolled; | |
| 1887 $('consumer-management-unenroll').hidden = !isEnrolled; | |
| 1888 ConsumerManagementOverlay.setEnrollmentStatus(isEnrolled); | |
| 1889 }; | |
| 1890 } | 1883 } |
| 1891 | 1884 |
| 1892 // Export | 1885 // Export |
| 1893 return { | 1886 return { |
| 1894 BrowserOptions: BrowserOptions | 1887 BrowserOptions: BrowserOptions |
| 1895 }; | 1888 }; |
| 1896 }); | 1889 }); |
| OLD | NEW |