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

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: 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..6655b7b829d38703130dbe3dae80fffee936c410 100644
--- a/chrome/browser/resources/settings/device_page/pointers.js
+++ b/chrome/browser/resources/settings/device_page/pointers.js
@@ -32,6 +32,11 @@ Polymer({
},
},
+ // Used to correctly identify when the mouse swap toggle has changed and
+ // the mouse button has been released. crbug.com/686949.
+ receivedMouseSwapButtonsUp_: false,
+ receivedMouseSwapButtonsChange_: false,
+
/**
* Prevents the link from activating its parent paper-radio-button.
* @param {!Event} e
@@ -46,8 +51,36 @@ Polymer({
* @param {boolean} hasMouse
* @param {boolean} hasTouchpad
* @return {string}
+ * @private
*/
getSubsectionClass_: function(hasMouse, hasTouchpad) {
return hasMouse && hasTouchpad ? 'subsection' : '';
},
+
+ /** @private */
+ onMouseSwapButtonsDown_: function() {
+ this.receivedMouseSwapButtonsUp_ = false;
michaelpg 2017/03/17 22:53:26 Tracking two booleans is confusing, and the "why"
michaelpg 2017/03/17 23:09:14 So as you said offline, keeping both booleans avoi
+ this.receivedMouseSwapButtonsChange_ = false;
+ },
+
+ /** @private */
+ onMouseSwapButtonsUp_: function() {
+ this.receivedMouseSwapButtonsUp_ = true;
+ this.maybeSendMouseSwapButtonsPrefChange_();
+ },
+
+ /** @private */
+ onMouseSwapButtonsChange_: function(event) {
+ this.receivedMouseSwapButtonsChange_ = true;
+ this.maybeSendMouseSwapButtonsPrefChange_();
+ },
+
+ /** @private */
+ maybeSendMouseSwapButtonsPrefChange_: function() {
+ if (this.receivedMouseSwapButtonsUp_ &&
+ this.receivedMouseSwapButtonsChange_) {
+ /** @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