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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
380 $('themes-native-button').onclick = function(event) { | 380 $('themes-native-button').onclick = function(event) { |
381 chrome.send('themesSetNative'); | 381 chrome.send('themesSetNative'); |
382 }; | 382 }; |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 // Date and time section (CrOS only). | 386 // Date and time section (CrOS only). |
387 if ($('set-time-button')) | 387 if ($('set-time-button')) |
388 $('set-time-button').onclick = this.handleSetTime_.bind(this); | 388 $('set-time-button').onclick = this.handleSetTime_.bind(this); |
389 | 389 |
390 // Timezone | |
391 if (loadTimeData.getBoolean('enableTimeZoneTrackingOption') && | |
392 cr.isChromeOS) { | |
stevenjb
2015/01/05 17:34:21
The entire 'Date and time section' is CrOS only, s
Alexander Alekseev
2015/01/15 18:59:02
Done.
| |
393 $('resolve-timezone-by-geolocation-selection').hidden = false; | |
394 this.setSystemTimezoneManaged_(false); | |
395 } | |
396 | |
390 // Default browser section. | 397 // Default browser section. |
391 if (!cr.isChromeOS) { | 398 if (!cr.isChromeOS) { |
392 if (!loadTimeData.getBoolean('showSetDefault')) { | 399 if (!loadTimeData.getBoolean('showSetDefault')) { |
393 $('set-default-browser-section').hidden = true; | 400 $('set-default-browser-section').hidden = true; |
394 } | 401 } |
395 $('set-as-default-browser').onclick = function(event) { | 402 $('set-as-default-browser').onclick = function(event) { |
396 chrome.send('becomeDefaultBrowser'); | 403 chrome.send('becomeDefaultBrowser'); |
397 }; | 404 }; |
398 | 405 |
399 $('auto-launch').onclick = this.handleAutoLaunchChanged_; | 406 $('auto-launch').onclick = this.handleAutoLaunchChanged_; |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1606 this.enableElementIfPossible_(getRequiredElement('set-wallpaper')); | 1613 this.enableElementIfPossible_(getRequiredElement('set-wallpaper')); |
1607 | 1614 |
1608 // Create a synthetic pref change event decorated as | 1615 // Create a synthetic pref change event decorated as |
1609 // CoreOptionsHandler::CreateValueForPref() does. | 1616 // CoreOptionsHandler::CreateValueForPref() does. |
1610 var event = new Event('wallpaper'); | 1617 var event = new Event('wallpaper'); |
1611 event.value = managed ? { controlledBy: 'policy' } : {}; | 1618 event.value = managed ? { controlledBy: 'policy' } : {}; |
1612 $('wallpaper-indicator').handlePrefChange(event); | 1619 $('wallpaper-indicator').handlePrefChange(event); |
1613 }, | 1620 }, |
1614 | 1621 |
1615 /** | 1622 /** |
1623 * @param {boolean} managed | |
1624 */ | |
1625 setSystemTimezoneManaged_: function(managed) { | |
1626 if (loadTimeData.getBoolean('enableTimeZoneTrackingOption')) { | |
1627 if (managed) { | |
1628 $('resolve-timezone-by-geolocation-selection').disabled = true; | |
1629 $('resolve-timezone-by-geolocation').onclick = function(event) {}; | |
1630 } else { | |
1631 this.enableElementIfPossible_( | |
1632 getRequiredElement('resolve-timezone-by-geolocation-selection')); | |
1633 $('resolve-timezone-by-geolocation').onclick = function(event) { | |
1634 $('timezone-value-select').disabled = event.currentTarget.checked; | |
1635 }; | |
1636 $('timezone-value-select').disabled = | |
1637 $('resolve-timezone-by-geolocation').checked; | |
1638 } | |
1639 } | |
1640 }, | |
1641 | |
1642 /** | |
1616 * Handle the 'add device' button click. | 1643 * Handle the 'add device' button click. |
1617 * @private | 1644 * @private |
1618 */ | 1645 */ |
1619 handleAddBluetoothDevice_: function() { | 1646 handleAddBluetoothDevice_: function() { |
1620 chrome.send('coreOptionsUserMetricsAction', | 1647 chrome.send('coreOptionsUserMetricsAction', |
1621 ['Options_BluetoothShowAddDevice']); | 1648 ['Options_BluetoothShowAddDevice']); |
1622 chrome.send('findBluetoothDevices'); | 1649 chrome.send('findBluetoothDevices'); |
1623 PageManager.showPageByName('bluetooth', false); | 1650 PageManager.showPageByName('bluetooth', false); |
1624 }, | 1651 }, |
1625 | 1652 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2202 } | 2229 } |
2203 button.textContent = loadTimeData.getString(strId); | 2230 button.textContent = loadTimeData.getString(strId); |
2204 }; | 2231 }; |
2205 } | 2232 } |
2206 | 2233 |
2207 // Export | 2234 // Export |
2208 return { | 2235 return { |
2209 BrowserOptions: BrowserOptions | 2236 BrowserOptions: BrowserOptions |
2210 }; | 2237 }; |
2211 }); | 2238 }); |
OLD | NEW |