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.exportPath('options'); | 5 cr.exportPath('options'); |
6 | 6 |
7 /** | 7 /** |
8 * @typedef {{actionLinkText: (string|undefined), | 8 * @typedef {{actionLinkText: (string|undefined), |
9 * childUser: (boolean|undefined), | 9 * childUser: (boolean|undefined), |
10 * hasError: (boolean|undefined), | 10 * hasError: (boolean|undefined), |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 */ | 111 */ |
112 resolveTimezoneByGeolocation_: false, | 112 resolveTimezoneByGeolocation_: false, |
113 | 113 |
114 /** | 114 /** |
115 * True if system timezone is managed by policy. | 115 * True if system timezone is managed by policy. |
116 * @private {boolean} | 116 * @private {boolean} |
117 */ | 117 */ |
118 systemTimezoneIsManaged_: false, | 118 systemTimezoneIsManaged_: false, |
119 | 119 |
120 /** | 120 /** |
121 * True if system timezone detection is managed by policy. | |
122 * @private {boolean} | |
123 */ | |
124 systemTimezoneAutomaticDetectionIsManaged_: false, | |
125 | |
126 /** | |
127 * This is the value of SystemTimezoneAutomaticDetection policy. | |
128 * @private {boolean} | |
129 */ | |
130 systemTimezoneAutomaticDetectionValue_: 0, | |
131 | |
132 /** | |
133 * Cached bluetooth adapter state. | 121 * Cached bluetooth adapter state. |
134 * @private {?chrome.bluetooth.AdapterState} | 122 * @private {?chrome.bluetooth.AdapterState} |
135 */ | 123 */ |
136 bluetoothAdapterState_: null, | 124 bluetoothAdapterState_: null, |
137 | 125 |
138 /** @override */ | 126 /** @override */ |
139 initializePage: function() { | 127 initializePage: function() { |
140 Page.prototype.initializePage.call(this); | 128 Page.prototype.initializePage.call(this); |
141 var self = this; | 129 var self = this; |
142 | 130 |
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1686 var event = new Event('wallpaper'); | 1674 var event = new Event('wallpaper'); |
1687 event.value = managed ? { controlledBy: 'policy' } : {}; | 1675 event.value = managed ? { controlledBy: 'policy' } : {}; |
1688 $('wallpaper-indicator').handlePrefChange(event); | 1676 $('wallpaper-indicator').handlePrefChange(event); |
1689 }, | 1677 }, |
1690 | 1678 |
1691 /** | 1679 /** |
1692 * This enables or disables dependent settings in timezone section. | 1680 * This enables or disables dependent settings in timezone section. |
1693 * @private | 1681 * @private |
1694 */ | 1682 */ |
1695 updateTimezoneSectionState_: function() { | 1683 updateTimezoneSectionState_: function() { |
1696 var self = this; | |
1697 $('resolve-timezone-by-geolocation') | |
1698 .onclick = function(event) { | |
1699 self.resolveTimezoneByGeolocation_ = event.currentTarget.checked; | |
1700 }; | |
1701 if (this.systemTimezoneIsManaged_) { | 1684 if (this.systemTimezoneIsManaged_) { |
1702 $('resolve-timezone-by-geolocation').disabled = true; | 1685 $('resolve-timezone-by-geolocation-selection').disabled = true; |
1703 $('resolve-timezone-by-geolocation').checked = false; | 1686 $('resolve-timezone-by-geolocation').onclick = function(event) {}; |
1704 } else if (this.systemTimezoneAutomaticDetectionIsManaged_) { | |
1705 if (this.systemTimezoneAutomaticDetectionValue_ == | |
1706 0 /* USERS_DECIDE */) { | |
1707 $('resolve-timezone-by-geolocation').disabled = false; | |
1708 $('resolve-timezone-by-geolocation') | |
1709 .checked = this.resolveTimezoneByGeolocation_; | |
1710 $('timezone-value-select') | |
1711 .disabled = this.resolveTimezoneByGeolocation_; | |
1712 } else { | |
1713 $('resolve-timezone-by-geolocation').disabled = true; | |
1714 $('resolve-timezone-by-geolocation') | |
1715 .checked = | |
1716 (this.systemTimezoneAutomaticDetectionValue_ != 1 /* DISABLED */); | |
1717 $('timezone-value-select').disabled = true; | |
1718 } | |
1719 } else { | 1687 } else { |
1720 this.enableElementIfPossible_( | 1688 this.enableElementIfPossible_( |
1721 getRequiredElement('resolve-timezone-by-geolocation')); | 1689 getRequiredElement('resolve-timezone-by-geolocation-selection')); |
| 1690 $('resolve-timezone-by-geolocation').onclick = function(event) { |
| 1691 $('timezone-value-select').disabled = event.currentTarget.checked; |
| 1692 }; |
1722 $('timezone-value-select').disabled = | 1693 $('timezone-value-select').disabled = |
1723 this.resolveTimezoneByGeolocation_; | 1694 this.resolveTimezoneByGeolocation_; |
1724 $('resolve-timezone-by-geolocation') | |
1725 .checked = this.resolveTimezoneByGeolocation_; | |
1726 } | 1695 } |
1727 }, | 1696 }, |
1728 | 1697 |
1729 /** | 1698 /** |
1730 * This is called from chromium code when system timezone "managed" state | 1699 * This is called from chromium code when system timezone "managed" state |
1731 * is changed. Enables or disables dependent settings. | 1700 * is changed. Enables or disables dependent settings. |
1732 * @param {boolean} managed Is true when system Timezone is managed by | 1701 * @param {boolean} managed Is true when system Timezone is managed by |
1733 * enterprise policy. False otherwize. | 1702 * enterprise policy. False otherwize. |
1734 */ | 1703 */ |
1735 setSystemTimezoneManaged_: function(managed) { | 1704 setSystemTimezoneManaged_: function(managed) { |
1736 this.systemTimezoneIsManaged_ = managed; | 1705 this.systemTimezoneIsManaged_ = managed; |
1737 this.updateTimezoneSectionState_(); | 1706 this.updateTimezoneSectionState_(); |
1738 }, | 1707 }, |
1739 | 1708 |
1740 /** | 1709 /** |
1741 * This is called from chromium code when system timezone detection | |
1742 * "managed" state is changed. Enables or disables dependent settings. | |
1743 * @param {boolean} managed Is true when system timezone autodetection is | |
1744 * managed by enterprise policy. False otherwize. | |
1745 */ | |
1746 setSystemTimezoneAutomaticDetectionManaged_: function(managed, value) { | |
1747 this.systemTimezoneAutomaticDetectionIsManaged_ = managed; | |
1748 this.systemTimezoneAutomaticDetectionValue_ = value; | |
1749 this.updateTimezoneSectionState_(); | |
1750 }, | |
1751 | |
1752 /** | |
1753 * This is Preferences event listener, which is called when | 1710 * This is Preferences event listener, which is called when |
1754 * kResolveTimezoneByGeolocation preference is changed. | 1711 * kResolveTimezoneByGeolocation preference is changed. |
1755 * Enables or disables dependent settings. | 1712 * Enables or disables dependent settings. |
1756 * @param {Event} value New preference state. | 1713 * @param {Event} value New preference state. |
1757 */ | 1714 */ |
1758 onResolveTimezoneByGeolocationChanged_: function(value) { | 1715 onResolveTimezoneByGeolocationChanged_: function(value) { |
1759 this.resolveTimezoneByGeolocation_ = value.value.value; | 1716 this.resolveTimezoneByGeolocation_ = value.value.value; |
1760 this.updateTimezoneSectionState_(); | 1717 this.updateTimezoneSectionState_(); |
1761 }, | 1718 }, |
1762 | 1719 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2291 'setNativeThemeButtonEnabled', | 2248 'setNativeThemeButtonEnabled', |
2292 'setNetworkPredictionValue', | 2249 'setNetworkPredictionValue', |
2293 'setNowSectionVisible', | 2250 'setNowSectionVisible', |
2294 'setHighContrastCheckboxState', | 2251 'setHighContrastCheckboxState', |
2295 'setAllHotwordSectionsVisible', | 2252 'setAllHotwordSectionsVisible', |
2296 'setMetricsReportingCheckboxState', | 2253 'setMetricsReportingCheckboxState', |
2297 'setMetricsReportingSettingVisibility', | 2254 'setMetricsReportingSettingVisibility', |
2298 'setProfilesInfo', | 2255 'setProfilesInfo', |
2299 'setSpokenFeedbackCheckboxState', | 2256 'setSpokenFeedbackCheckboxState', |
2300 'setSystemTimezoneManaged', | 2257 'setSystemTimezoneManaged', |
2301 'setSystemTimezoneAutomaticDetectionManaged', | |
2302 'setThemesResetButtonEnabled', | 2258 'setThemesResetButtonEnabled', |
2303 'setVirtualKeyboardCheckboxState', | 2259 'setVirtualKeyboardCheckboxState', |
2304 'setupPageZoomSelector', | 2260 'setupPageZoomSelector', |
2305 'setupProxySettingsButton', | 2261 'setupProxySettingsButton', |
2306 'setAudioHistorySectionVisible', | 2262 'setAudioHistorySectionVisible', |
2307 'showCreateProfileError', | 2263 'showCreateProfileError', |
2308 'showCreateProfileSuccess', | 2264 'showCreateProfileSuccess', |
2309 'showCreateProfileWarning', | 2265 'showCreateProfileWarning', |
2310 'showHotwordAlwaysOnSection', | 2266 'showHotwordAlwaysOnSection', |
2311 'showHotwordNoDspSection', | 2267 'showHotwordNoDspSection', |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2378 if (section) | 2334 if (section) |
2379 section.hidden = true; | 2335 section.hidden = true; |
2380 }; | 2336 }; |
2381 } | 2337 } |
2382 | 2338 |
2383 // Export | 2339 // Export |
2384 return { | 2340 return { |
2385 BrowserOptions: BrowserOptions | 2341 BrowserOptions: BrowserOptions |
2386 }; | 2342 }; |
2387 }); | 2343 }); |
OLD | NEW |