| 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 * @param {boolean} managed |
| 1625 */ |
| 1626 setSystemTimezoneManaged_: function(managed) { |
| 1627 if (loadTimeData.getBoolean('enableTimeZoneTrackingOption')) { |
| 1628 if (managed) { |
| 1629 $('resolve-timezone-by-geolocation-selection').disabled = true; |
| 1630 $('resolve-timezone-by-geolocation').onclick = function(event) {}; |
| 1631 } else { |
| 1632 this.enableElementIfPossible_( |
| 1633 getRequiredElement('resolve-timezone-by-geolocation-selection')); |
| 1634 $('resolve-timezone-by-geolocation').onclick = function(event) { |
| 1635 $('timezone-value-select').disabled = event.currentTarget.checked; |
| 1636 }; |
| 1637 $('timezone-value-select').disabled = |
| 1638 $('resolve-timezone-by-geolocation').checked; |
| 1639 } |
| 1640 } |
| 1641 }, |
| 1642 |
| 1643 /** |
| 1616 * Handle the 'add device' button click. | 1644 * Handle the 'add device' button click. |
| 1617 * @private | 1645 * @private |
| 1618 */ | 1646 */ |
| 1619 handleAddBluetoothDevice_: function() { | 1647 handleAddBluetoothDevice_: function() { |
| 1620 chrome.send('coreOptionsUserMetricsAction', | 1648 chrome.send('coreOptionsUserMetricsAction', |
| 1621 ['Options_BluetoothShowAddDevice']); | 1649 ['Options_BluetoothShowAddDevice']); |
| 1622 chrome.send('findBluetoothDevices'); | 1650 chrome.send('findBluetoothDevices'); |
| 1623 PageManager.showPageByName('bluetooth', false); | 1651 PageManager.showPageByName('bluetooth', false); |
| 1624 }, | 1652 }, |
| 1625 | 1653 |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2202 } | 2230 } |
| 2203 button.textContent = loadTimeData.getString(strId); | 2231 button.textContent = loadTimeData.getString(strId); |
| 2204 }; | 2232 }; |
| 2205 } | 2233 } |
| 2206 | 2234 |
| 2207 // Export | 2235 // Export |
| 2208 return { | 2236 return { |
| 2209 BrowserOptions: BrowserOptions | 2237 BrowserOptions: BrowserOptions |
| 2210 }; | 2238 }; |
| 2211 }); | 2239 }); |
| OLD | NEW |