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

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

Issue 400993003: Save slider preferences when using touch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Can only test CrOS Created 6 years, 5 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 | Annotate | Revision Log
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.define('options', function() { 5 cr.define('options', function() {
6 6
7 var Preferences = options.Preferences; 7 var Preferences = options.Preferences;
8 8
9 /** 9 /**
10 * Allows an element to be disabled for several reasons. 10 * Allows an element to be disabled for several reasons.
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 decorate: function() { 289 decorate: function() {
290 PrefInputElement.prototype.decorate.call(this); 290 PrefInputElement.prototype.decorate.call(this);
291 this.type = 'range'; 291 this.type = 'range';
292 292
293 // Listen for user events. 293 // Listen for user events.
294 // TODO(jhawkins): Add onmousewheel handling once the associated WK bug is 294 // TODO(jhawkins): Add onmousewheel handling once the associated WK bug is
295 // fixed. 295 // fixed.
296 // https://bugs.webkit.org/show_bug.cgi?id=52256 296 // https://bugs.webkit.org/show_bug.cgi?id=52256
297 this.addEventListener('keyup', this.handleRelease_.bind(this)); 297 this.addEventListener('keyup', this.handleRelease_.bind(this));
298 this.addEventListener('mouseup', this.handleRelease_.bind(this)); 298 this.addEventListener('mouseup', this.handleRelease_.bind(this));
299 this.addEventListener('touchcancel', this.handleRelease_.bind(this));
300 this.addEventListener('touchend', this.handleRelease_.bind(this));
299 }, 301 },
300 302
301 /** 303 /**
302 * Update the associated pref when when the user releases the slider. 304 * Update the associated pref when when the user releases the slider.
303 * @private 305 * @private
304 */ 306 */
305 updatePrefFromState_: function() { 307 updatePrefFromState_: function() {
306 Preferences.setIntegerPref(this.pref, this.mapPositionToPref(this.value), 308 Preferences.setIntegerPref(this.pref, this.mapPositionToPref(this.value),
307 !this.dialogPref, this.metric); 309 !this.dialogPref, this.metric);
308 }, 310 },
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 PrefNumber: PrefNumber, 555 PrefNumber: PrefNumber,
554 PrefRadio: PrefRadio, 556 PrefRadio: PrefRadio,
555 PrefRange: PrefRange, 557 PrefRange: PrefRange,
556 PrefSelect: PrefSelect, 558 PrefSelect: PrefSelect,
557 PrefTextField: PrefTextField, 559 PrefTextField: PrefTextField,
558 PrefPortNumber: PrefPortNumber, 560 PrefPortNumber: PrefPortNumber,
559 PrefButton: PrefButton 561 PrefButton: PrefButton
560 }; 562 };
561 563
562 }); 564 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/browser_options.html ('k') | chrome/browser/ui/webui/options/options_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698