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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 }; | 379 }; |
380 | 380 |
381 if ($('themes-native-button')) { | 381 if ($('themes-native-button')) { |
382 $('themes-native-button').onclick = function(event) { | 382 $('themes-native-button').onclick = function(event) { |
383 chrome.send('themesSetNative'); | 383 chrome.send('themesSetNative'); |
384 }; | 384 }; |
385 } | 385 } |
386 } | 386 } |
387 | 387 |
388 // Date and time section (CrOS only). | 388 // Date and time section (CrOS only). |
389 if ($('set-time-button')) | 389 if (cr.isChromeOS) { |
390 $('set-time-button').onclick = this.handleSetTime_.bind(this); | 390 if ($('set-time-button')) |
| 391 $('set-time-button').onclick = this.handleSetTime_.bind(this); |
| 392 |
| 393 // Timezone |
| 394 if (loadTimeData.getBoolean('enableTimeZoneTrackingOption')) { |
| 395 $('resolve-timezone-by-geolocation-selection').hidden = false; |
| 396 this.setSystemTimezoneManaged_(false); |
| 397 } |
| 398 } |
391 | 399 |
392 // Default browser section. | 400 // Default browser section. |
393 if (!cr.isChromeOS) { | 401 if (!cr.isChromeOS) { |
394 if (!loadTimeData.getBoolean('showSetDefault')) { | 402 if (!loadTimeData.getBoolean('showSetDefault')) { |
395 $('set-default-browser-section').hidden = true; | 403 $('set-default-browser-section').hidden = true; |
396 } | 404 } |
397 $('set-as-default-browser').onclick = function(event) { | 405 $('set-as-default-browser').onclick = function(event) { |
398 chrome.send('becomeDefaultBrowser'); | 406 chrome.send('becomeDefaultBrowser'); |
399 }; | 407 }; |
400 | 408 |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 this.enableElementIfPossible_(getRequiredElement('set-wallpaper')); | 1615 this.enableElementIfPossible_(getRequiredElement('set-wallpaper')); |
1608 | 1616 |
1609 // Create a synthetic pref change event decorated as | 1617 // Create a synthetic pref change event decorated as |
1610 // CoreOptionsHandler::CreateValueForPref() does. | 1618 // CoreOptionsHandler::CreateValueForPref() does. |
1611 var event = new Event('wallpaper'); | 1619 var event = new Event('wallpaper'); |
1612 event.value = managed ? { controlledBy: 'policy' } : {}; | 1620 event.value = managed ? { controlledBy: 'policy' } : {}; |
1613 $('wallpaper-indicator').handlePrefChange(event); | 1621 $('wallpaper-indicator').handlePrefChange(event); |
1614 }, | 1622 }, |
1615 | 1623 |
1616 /** | 1624 /** |
| 1625 * This is called from chromium code when system timezone "managed" state |
| 1626 * is changed. Enables or disables dependent settings. |
| 1627 * @param {boolean} managed Is true when system Timezone is managed by |
| 1628 * enterprise policy. False otherwize. |
| 1629 */ |
| 1630 setSystemTimezoneManaged_: function(managed) { |
| 1631 if (loadTimeData.getBoolean('enableTimeZoneTrackingOption')) { |
| 1632 if (managed) { |
| 1633 $('resolve-timezone-by-geolocation-selection').disabled = true; |
| 1634 $('resolve-timezone-by-geolocation').onclick = function(event) {}; |
| 1635 } else { |
| 1636 this.enableElementIfPossible_( |
| 1637 getRequiredElement('resolve-timezone-by-geolocation-selection')); |
| 1638 $('resolve-timezone-by-geolocation').onclick = function(event) { |
| 1639 $('timezone-value-select').disabled = event.currentTarget.checked; |
| 1640 }; |
| 1641 $('timezone-value-select').disabled = |
| 1642 $('resolve-timezone-by-geolocation').checked; |
| 1643 } |
| 1644 } |
| 1645 }, |
| 1646 |
| 1647 /** |
1617 * Handle the 'add device' button click. | 1648 * Handle the 'add device' button click. |
1618 * @private | 1649 * @private |
1619 */ | 1650 */ |
1620 handleAddBluetoothDevice_: function() { | 1651 handleAddBluetoothDevice_: function() { |
1621 chrome.send('coreOptionsUserMetricsAction', | 1652 chrome.send('coreOptionsUserMetricsAction', |
1622 ['Options_BluetoothShowAddDevice']); | 1653 ['Options_BluetoothShowAddDevice']); |
1623 chrome.send('findBluetoothDevices'); | 1654 chrome.send('findBluetoothDevices'); |
1624 PageManager.showPageByName('bluetooth', false); | 1655 PageManager.showPageByName('bluetooth', false); |
1625 }, | 1656 }, |
1626 | 1657 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 } | 2234 } |
2204 button.textContent = loadTimeData.getString(strId); | 2235 button.textContent = loadTimeData.getString(strId); |
2205 }; | 2236 }; |
2206 } | 2237 } |
2207 | 2238 |
2208 // Export | 2239 // Export |
2209 return { | 2240 return { |
2210 BrowserOptions: BrowserOptions | 2241 BrowserOptions: BrowserOptions |
2211 }; | 2242 }; |
2212 }); | 2243 }); |
OLD | NEW |