Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 console.info('change'); | |
|
michaelpg
2017/03/17 23:34:41
remove
stevenjb
2017/03/24 19:32:24
Doh. Thanks.
| |
| 68 /** @type {!SettingsToggleButtonElement} */ (this.$.mouseSwapButton) | |
| 69 .sendPrefChange(); | |
| 70 }, | |
| 71 | |
| 72 /** @private */ | |
| 73 onMouseSwapButtonsChange_: function(event) { | |
| 74 if (!this.receivedMouseSwapButtonsDown_) { | |
| 75 console.info('change'); | |
|
michaelpg
2017/03/17 23:34:41
remove
stevenjb
2017/03/24 19:32:24
Done.
| |
| 76 /** @type {!SettingsToggleButtonElement} */ (this.$.mouseSwapButton) | |
| 77 .sendPrefChange(); | |
| 78 } | |
| 79 }, | |
| 53 }); | 80 }); |
| OLD | NEW |