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

Side by Side Diff: chrome/browser/resources/shared/js/cr/ui/repeating_button.js

Issue 8437004: Add unit test for the repeating button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linewrap. 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
« no previous file with comments | « no previous file | chrome/browser/resources/shared/js/cr/ui/repeating_button_test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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('cr.ui', function() { 5 cr.define('cr.ui', function() {
6 /** 6 /**
7 * Creates a new button element. The repeating button behaves like a 7 * Creates a new button element. The repeating button behaves like a
8 * keyboard button, which auto-repeats if held. This button is designed 8 * keyboard button, which auto-repeats if held. This button is designed
9 * for use with controls such as brightness and volume adjustment buttons. 9 * for use with controls such as brightness and volume adjustment buttons.
10 * @constructor 10 * @constructor
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 this.intervalCallback_ = undefined; 135 this.intervalCallback_ = undefined;
136 } 136 }
137 }, 137 },
138 138
139 /** 139 /**
140 * Dispatches the action associated with keeping this button pressed. 140 * Dispatches the action associated with keeping this button pressed.
141 * @private 141 * @private
142 */ 142 */
143 buttonHeld_: function() { 143 buttonHeld_: function() {
144 cr.dispatchSimpleEvent(this, RepeatingButton.Event.BUTTON_HELD); 144 cr.dispatchSimpleEvent(this, RepeatingButton.Event.BUTTON_HELD);
145 },
146
147 /**
148 * Getter for the initial delay before repeating.
149 * @type {number} The delay in milliseconds.
150 */
151 get repeatDelay() {
152 return this.holdDelayTime_;
153 },
154
155 /**
156 * Getter for the repeat interval.
157 * @type {number} The repeat interval in milliseconds.
158 */
159 get repeatInterval() {
160 return this.holdRepeatIntervalTime_;
145 } 161 }
146 }; 162 };
147 163
148 return { 164 return {
149 RepeatingButton: RepeatingButton 165 RepeatingButton: RepeatingButton
150 }; 166 };
151 }); 167 });
152 168
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/shared/js/cr/ui/repeating_button_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698