Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 2644713002: cros: Use runtime stylus detection for ash palette. (Closed)
Patch Set: Fix test Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 * accountInfo: (string|undefined), 9 * accountInfo: (string|undefined),
10 * childUser: (boolean|undefined), 10 * childUser: (boolean|undefined),
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 $('themes-native-button').disabled = true; 332 $('themes-native-button').disabled = true;
333 $('themes-native-button').hidden = true; 333 $('themes-native-button').hidden = true;
334 } 334 }
335 // Supervised users have just one default theme, even on Linux. So use 335 // Supervised users have just one default theme, even on Linux. So use
336 // the same button for Linux as for the other platforms. 336 // the same button for Linux as for the other platforms.
337 $('themes-reset').textContent = loadTimeData.getString('themesReset'); 337 $('themes-reset').textContent = loadTimeData.getString('themesReset');
338 } 338 }
339 339
340 // Device section (ChromeOS only). 340 // Device section (ChromeOS only).
341 if (cr.isChromeOS) { 341 if (cr.isChromeOS) {
342 if (loadTimeData.getBoolean('showStylusSettings')) { 342 // Probe for stylus hardware state. C++ will invoke
343 $('stylus-settings-link').onclick = function(event) { 343 // BrowserOptions.setStylusInputStatus_ when the data is available.
344 PageManager.showPageByName('stylus-overlay'); 344 chrome.send('requestStylusHardwareState');
345 }; 345
346 $('stylus-row').hidden = false;
347 }
348 if (loadTimeData.getBoolean('showPowerStatus')) { 346 if (loadTimeData.getBoolean('showPowerStatus')) {
349 $('power-settings-link').onclick = function(evt) { 347 $('power-settings-link').onclick = function(evt) {
350 PageManager.showPageByName('power-overlay'); 348 PageManager.showPageByName('power-overlay');
351 chrome.send('coreOptionsUserMetricsAction', 349 chrome.send('coreOptionsUserMetricsAction',
352 ['Options_ShowPowerSettings']); 350 ['Options_ShowPowerSettings']);
353 }; 351 };
354 $('power-row').hidden = false; 352 $('power-row').hidden = false;
355 } 353 }
356 $('keyboard-settings-button').onclick = function(evt) { 354 $('keyboard-settings-button').onclick = function(evt) {
357 PageManager.showPageByName('keyboard-overlay'); 355 PageManager.showPageByName('keyboard-overlay');
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 this.enableElementIfPossible_( 1805 this.enableElementIfPossible_(
1808 getRequiredElement('resolve-timezone-by-geolocation')); 1806 getRequiredElement('resolve-timezone-by-geolocation'));
1809 $('timezone-value-select').disabled = 1807 $('timezone-value-select').disabled =
1810 this.resolveTimezoneByGeolocation_; 1808 this.resolveTimezoneByGeolocation_;
1811 $('resolve-timezone-by-geolocation') 1809 $('resolve-timezone-by-geolocation')
1812 .checked = this.resolveTimezoneByGeolocation_; 1810 .checked = this.resolveTimezoneByGeolocation_;
1813 } 1811 }
1814 }, 1812 },
1815 1813
1816 /** 1814 /**
1815 * Called when stylus hardware detection probing is complete.
1816 * @param {boolean} hasStylus
1817 * @private
1818 */
1819 setStylusInputStatus_: function(hasStylus) {
1820 if (!hasStylus)
1821 return;
1822
1823 $('stylus-settings-link').onclick = function(event) {
1824 PageManager.showPageByName('stylus-overlay');
1825 };
1826 $('stylus-row').hidden = false;
1827 },
1828
1829 /**
1817 * This is called from chromium code when system timezone "managed" state 1830 * This is called from chromium code when system timezone "managed" state
1818 * is changed. Enables or disables dependent settings. 1831 * is changed. Enables or disables dependent settings.
1819 * @param {boolean} managed Is true when system Timezone is managed by 1832 * @param {boolean} managed Is true when system Timezone is managed by
1820 * enterprise policy. False otherwize. 1833 * enterprise policy. False otherwize.
1821 */ 1834 */
1822 setSystemTimezoneManaged_: function(managed) { 1835 setSystemTimezoneManaged_: function(managed) {
1823 this.systemTimezoneIsManaged_ = managed; 1836 this.systemTimezoneIsManaged_ = managed;
1824 this.updateTimezoneSectionState_(); 1837 this.updateTimezoneSectionState_();
1825 }, 1838 },
1826 1839
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 'setFontSize', 2418 'setFontSize',
2406 'setHighContrastCheckboxState', 2419 'setHighContrastCheckboxState',
2407 'setHotwordRetrainLinkVisible', 2420 'setHotwordRetrainLinkVisible',
2408 'setMetricsReportingCheckboxState', 2421 'setMetricsReportingCheckboxState',
2409 'setMetricsReportingSettingVisibility', 2422 'setMetricsReportingSettingVisibility',
2410 'setNativeThemeButtonEnabled', 2423 'setNativeThemeButtonEnabled',
2411 'setNetworkPredictionValue', 2424 'setNetworkPredictionValue',
2412 'setNowSectionVisible', 2425 'setNowSectionVisible',
2413 'setProfilesInfo', 2426 'setProfilesInfo',
2414 'setSpokenFeedbackCheckboxState', 2427 'setSpokenFeedbackCheckboxState',
2428 'setStylusInputStatus',
2415 'setSystemTimezoneAutomaticDetectionManaged', 2429 'setSystemTimezoneAutomaticDetectionManaged',
2416 'setSystemTimezoneManaged', 2430 'setSystemTimezoneManaged',
2417 'setThemesResetButtonEnabled', 2431 'setThemesResetButtonEnabled',
2418 'setVirtualKeyboardCheckboxState', 2432 'setVirtualKeyboardCheckboxState',
2419 'setWallpaperManaged', 2433 'setWallpaperManaged',
2420 'setupPageZoomSelector', 2434 'setupPageZoomSelector',
2421 'setupProxySettingsButton', 2435 'setupProxySettingsButton',
2422 'showCreateProfileError', 2436 'showCreateProfileError',
2423 'showCreateProfileSuccess', 2437 'showCreateProfileSuccess',
2424 'showCreateProfileWarning', 2438 'showCreateProfileWarning',
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 2485
2472 settings.hidden = !isVisible; 2486 settings.hidden = !isVisible;
2473 }; 2487 };
2474 } 2488 }
2475 2489
2476 // Export 2490 // Export
2477 return { 2491 return {
2478 BrowserOptions: BrowserOptions 2492 BrowserOptions: BrowserOptions
2479 }; 2493 };
2480 }); 2494 });
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/note_taking_helper_unittest.cc ('k') | chrome/browser/resources/settings/device_page/device_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698