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

Unified Diff: ui/base/win/events_win.cc

Issue 10823380: Wires up MouseEvent changed flags on windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/win/events_win.cc
diff --git a/ui/base/win/events_win.cc b/ui/base/win/events_win.cc
index 984e7ca3d6736cfcce595600657cca9762332872..9b13891613d5f265358b1d892f6a0cec89194593 100644
--- a/ui/base/win/events_win.cc
+++ b/ui/base/win/events_win.cc
@@ -111,10 +111,6 @@ int KeyStateFlagsFromNative(const base::NativeEvent& native_event) {
// Returns a mask corresponding to the set of pressed mouse buttons.
// This includes the button of the given message, even if it is being released.
int MouseStateFlagsFromNative(const base::NativeEvent& native_event) {
- // TODO(msw): ORing the pressed/released button into the flags is _wrong_.
- // It makes it impossible to tell which button was modified when multiple
- // buttons are/were held down. Instead, we need to track the modified button
- // independently and audit event consumers to do the right thing.
int win_flags = GetNativeMouseKey(native_event);
// Client mouse messages provide key states in their WPARAMs.
@@ -226,7 +222,17 @@ bool IsMouseEvent(const base::NativeEvent& native_event) {
int GetChangedMouseButtonFlagsFromNative(
const base::NativeEvent& native_event) {
- // TODO(sky): implement me.
+ switch (GetNativeMouseKey(native_event)) {
+ case MK_LBUTTON:
+ return EF_LEFT_MOUSE_BUTTON;
+ case MK_MBUTTON:
+ return EF_MIDDLE_MOUSE_BUTTON;
+ case MK_RBUTTON:
+ return EF_RIGHT_MOUSE_BUTTON;
+ // TODO: add support for MK_XBUTTON1.
+ default:
+ break;
+ }
return 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698