| Index: chrome/browser/resources/options/chromeos/system_options.js
|
| diff --git a/chrome/browser/resources/options/chromeos/system_options.js b/chrome/browser/resources/options/chromeos/system_options.js
|
| index 75c8777767792ef7ad2c59f1065d7f9c96f360a4..0d71ef2e187a21a6e93a036e3f2b8b92c2bb6b5c 100644
|
| --- a/chrome/browser/resources/options/chromeos/system_options.js
|
| +++ b/chrome/browser/resources/options/chromeos/system_options.js
|
| @@ -5,6 +5,8 @@
|
| cr.define('options', function() {
|
|
|
| var OptionsPage = options.OptionsPage;
|
| + var RepeatingButton = cr.ui.RepeatingButton;
|
| +
|
| /////////////////////////////////////////////////////////////////////////////
|
| // SystemOptions class:
|
|
|
| @@ -63,27 +65,24 @@ cr.define('options', function() {
|
| chrome.send('accessibilityChange',
|
| [String($('accesibility-check').checked)]);
|
| };
|
| -
|
| - if (cr.isTouch) {
|
| - initializeBrightnessButton_('brightness-decrease-button',
|
| - 'decreaseScreenBrightness');
|
| - initializeBrightnessButton_('brightness-increase-button',
|
| - 'increaseScreenBrightness');
|
| - }
|
| + initializeBrightnessButton_('brightness-decrease-button',
|
| + 'decreaseScreenBrightness');
|
| + initializeBrightnessButton_('brightness-increase-button',
|
| + 'increaseScreenBrightness');
|
| }
|
| };
|
|
|
| /**
|
| - * Initializes a button for controlling screen brightness on touch builds of
|
| - * ChromeOS.
|
| + * Initializes a button for controlling screen brightness.
|
| * @param {string} id Button ID.
|
| * @param {string} callback Name of the callback function.
|
| */
|
| function initializeBrightnessButton_(id, callback) {
|
| - // TODO(kevers): Make brightness buttons auto-repeat if held.
|
| - $(id).onclick = function(event) {
|
| + var button = $(id);
|
| + cr.ui.decorate(button, RepeatingButton);
|
| + button.onButtonHeldAction = function() {
|
| chrome.send(callback);
|
| - }
|
| + };
|
| }
|
|
|
| /**
|
|
|