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