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

Side by Side Diff: chrome/browser/resources/options/chromeos/system_options.js

Issue 8340002: Enable brightness controls for all ChromeOS builds. Make brightness controls auto-repeat. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix arming the repeat button on the start of a touch gesture. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.define('options', function() { 5 cr.define('options', function() {
6 6
7 var OptionsPage = options.OptionsPage; 7 var OptionsPage = options.OptionsPage;
8 var RepeatingButton = cr.ui.RepeatingButton;
9
8 ///////////////////////////////////////////////////////////////////////////// 10 /////////////////////////////////////////////////////////////////////////////
9 // SystemOptions class: 11 // SystemOptions class:
10 12
11 /** 13 /**
12 * Encapsulated handling of ChromeOS system options page. 14 * Encapsulated handling of ChromeOS system options page.
13 * @constructor 15 * @constructor
14 */ 16 */
15 17
16 function SystemOptions() { 18 function SystemOptions() {
17 OptionsPage.call(this, 'system', templateData.systemPageTabTitle, 19 OptionsPage.call(this, 'system', templateData.systemPageTabTitle,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 $('language-button').onclick = function(event) { 58 $('language-button').onclick = function(event) {
57 OptionsPage.navigateToPage('language'); 59 OptionsPage.navigateToPage('language');
58 }; 60 };
59 $('modifier-keys-button').onclick = function(event) { 61 $('modifier-keys-button').onclick = function(event) {
60 OptionsPage.navigateToPage('languageCustomizeModifierKeysOverlay'); 62 OptionsPage.navigateToPage('languageCustomizeModifierKeysOverlay');
61 }; 63 };
62 $('accesibility-check').onchange = function(event) { 64 $('accesibility-check').onchange = function(event) {
63 chrome.send('accessibilityChange', 65 chrome.send('accessibilityChange',
64 [String($('accesibility-check').checked)]); 66 [String($('accesibility-check').checked)]);
65 }; 67 };
66 68 initializeBrightnessButton_('brightness-decrease-button',
67 if (cr.isTouch) { 69 'decreaseScreenBrightness');
68 initializeBrightnessButton_('brightness-decrease-button', 70 initializeBrightnessButton_('brightness-increase-button',
69 'decreaseScreenBrightness'); 71 'increaseScreenBrightness');
70 initializeBrightnessButton_('brightness-increase-button',
71 'increaseScreenBrightness');
72 }
73 } 72 }
74 }; 73 };
75 74
76 /** 75 /**
77 * Initializes a button for controlling screen brightness on touch builds of 76 * Initializes a button for controlling screen brightness.
78 * ChromeOS.
79 * @param {string} id Button ID. 77 * @param {string} id Button ID.
80 * @param {string} callback Name of the callback function. 78 * @param {string} callback Name of the callback function.
81 */ 79 */
82 function initializeBrightnessButton_(id, callback) { 80 function initializeBrightnessButton_(id, callback) {
83 // TODO(kevers): Make brightness buttons auto-repeat if held. 81 var button = $(id);
84 $(id).onclick = function(event) { 82 cr.ui.decorate(button, RepeatingButton);
83 button.onButtonHeldAction = function() {
85 chrome.send(callback); 84 chrome.send(callback);
86 } 85 };
87 } 86 }
88 87
89 /** 88 /**
90 * Scan for bluetooth devices. 89 * Scan for bluetooth devices.
91 * @private 90 * @private
92 */ 91 */
93 function findBluetoothDevices_() { 92 function findBluetoothDevices_() {
94 setVisibility_('bluetooth-scanning-label', true); 93 setVisibility_('bluetooth-scanning-label', true);
95 setVisibility_('bluetooth-scanning-icon', true); 94 setVisibility_('bluetooth-scanning-icon', true);
96 95
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 setVisibility_('bluetooth-scanning-icon', false); 161 setVisibility_('bluetooth-scanning-icon', false);
163 }, 2000); 162 }, 2000);
164 } 163 }
165 164
166 // Export 165 // Export
167 return { 166 return {
168 SystemOptions: SystemOptions 167 SystemOptions: SystemOptions
169 }; 168 };
170 169
171 }); 170 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698