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

Unified 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: Simplify 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/settings/device_page/pointers.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/device_page/pointers.js
diff --git a/chrome/browser/resources/settings/device_page/pointers.js b/chrome/browser/resources/settings/device_page/pointers.js
index dda8bf02cc67229a128dc0edfe0e4890b2e6de42..c53a95d1b5af2edc7d5d739334ec23e06bf99cef 100644
--- a/chrome/browser/resources/settings/device_page/pointers.js
+++ b/chrome/browser/resources/settings/device_page/pointers.js
@@ -32,6 +32,10 @@ Polymer({
},
},
+ // Used to correctly identify when the mouse button has been released.
+ // crbug.com/686949.
+ receivedMouseSwapButtonsDown_: false,
+
/**
* Prevents the link from activating its parent paper-radio-button.
* @param {!Event} e
@@ -46,8 +50,31 @@ Polymer({
* @param {boolean} hasMouse
* @param {boolean} hasTouchpad
* @return {string}
+ * @private
*/
getSubsectionClass_: function(hasMouse, hasTouchpad) {
return hasMouse && hasTouchpad ? 'subsection' : '';
},
+
+ /** @private */
+ onMouseSwapButtonsDown_: function() {
+ this.receivedMouseSwapButtonsDown_ = true;
+ },
+
+ /** @private */
+ onMouseSwapButtonsUp_: function() {
+ this.receivedMouseSwapButtonsDown_ = false;
+ console.info('change');
michaelpg 2017/03/17 23:34:41 remove
stevenjb 2017/03/24 19:32:24 Doh. Thanks.
+ /** @type {!SettingsToggleButtonElement} */ (this.$.mouseSwapButton)
+ .sendPrefChange();
+ },
+
+ /** @private */
+ onMouseSwapButtonsChange_: function(event) {
+ if (!this.receivedMouseSwapButtonsDown_) {
+ console.info('change');
michaelpg 2017/03/17 23:34:41 remove
stevenjb 2017/03/24 19:32:24 Done.
+ /** @type {!SettingsToggleButtonElement} */ (this.$.mouseSwapButton)
+ .sendPrefChange();
+ }
+ },
});
« 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