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 56ccd2636f19605e62367fb7e4b2e3c2b85890ae..a447a26b04696a181b3b3985a99eaaddd390bba4 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.addEventListener(RepeatingButton.Event.BUTTON_HELD, function(e) { |
chrome.send(callback); |
- } |
+ }); |
} |
/** |