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

Side by Side Diff: chrome/browser/resources/settings/device_page/pointers.js

Issue 2753353002: MD Settings: Pointers: Avoid setting mouse swap pref while mouse pressed (Closed)
Patch Set: Elim console.log Created 3 years, 9 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
« no previous file with comments | « chrome/browser/resources/settings/device_page/pointers.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-pointers' is the settings subpage with mouse and touchpad settings. 7 * 'settings-pointers' is the settings subpage with mouse and touchpad settings.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-pointers', 10 is: 'settings-pointers',
(...skipping 14 matching lines...) Expand all
25 * @const {!Array<number>} 25 * @const {!Array<number>}
26 * @private 26 * @private
27 */ 27 */
28 sensitivityValues_: { 28 sensitivityValues_: {
29 type: Array, 29 type: Array,
30 value: [1, 2, 3, 4, 5], 30 value: [1, 2, 3, 4, 5],
31 readOnly: true, 31 readOnly: true,
32 }, 32 },
33 }, 33 },
34 34
35 // Used to correctly identify when the mouse button has been released.
36 // crbug.com/686949.
37 receivedMouseSwapButtonsDown_: false,
38
35 /** 39 /**
36 * Prevents the link from activating its parent paper-radio-button. 40 * Prevents the link from activating its parent paper-radio-button.
37 * @param {!Event} e 41 * @param {!Event} e
38 * @private 42 * @private
39 */ 43 */
40 onLearnMoreLinkActivated_: function(e) { 44 onLearnMoreLinkActivated_: function(e) {
41 settings.DevicePageBrowserProxyImpl.getInstance().handleLinkEvent(e); 45 settings.DevicePageBrowserProxyImpl.getInstance().handleLinkEvent(e);
42 }, 46 },
43 47
44 /** 48 /**
45 * Mouse and touchpad sections are only subsections if they are both present. 49 * Mouse and touchpad sections are only subsections if they are both present.
46 * @param {boolean} hasMouse 50 * @param {boolean} hasMouse
47 * @param {boolean} hasTouchpad 51 * @param {boolean} hasTouchpad
48 * @return {string} 52 * @return {string}
53 * @private
49 */ 54 */
50 getSubsectionClass_: function(hasMouse, hasTouchpad) { 55 getSubsectionClass_: function(hasMouse, hasTouchpad) {
51 return hasMouse && hasTouchpad ? 'subsection' : ''; 56 return hasMouse && hasTouchpad ? 'subsection' : '';
52 }, 57 },
58
59 /** @private */
60 onMouseSwapButtonsDown_: function() {
61 this.receivedMouseSwapButtonsDown_ = true;
62 },
63
64 /** @private */
65 onMouseSwapButtonsUp_: function() {
66 this.receivedMouseSwapButtonsDown_ = false;
67 /** @type {!SettingsToggleButtonElement} */ (this.$.mouseSwapButton)
68 .sendPrefChange();
69 },
70
71 /** @private */
72 onMouseSwapButtonsChange_: function(event) {
73 if (!this.receivedMouseSwapButtonsDown_) {
74 /** @type {!SettingsToggleButtonElement} */ (this.$.mouseSwapButton)
75 .sendPrefChange();
76 }
77 },
53 }); 78 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/device_page/pointers.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698