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

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

Issue 10381063: Aura/ash split: Don't use X11 window borders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with windows/mac implementations Created 8 years, 7 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
Index: ui/base/win/events_win.cc
diff --git a/ui/base/win/events_win.cc b/ui/base/win/events_win.cc
index 9f75b6f18ee02565adb6136f373924c534dcab05..ce1700aae7c65d76a59130222c912e1eb4e7d5ac 100644
--- a/ui/base/win/events_win.cc
+++ b/ui/base/win/events_win.cc
@@ -211,6 +211,24 @@ gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
return gfx::Point(native_point);
}
+gfx::Point EventRootLocationFromNative(const base::NativeEvent& native_event) {
+ // Note: Wheel events are considered client, but their position is in screen
+ // coordinates.
+ // Client message. The position is contained in the LPARAM.
+ if (IsClientMouseEvent(native_event) && !IsMouseWheelEvent(native_event))
+ return gfx::Point(native_event.lParam);
+ DCHECK(IsNonClientMouseEvent(native_event) ||
+ IsMouseWheelEvent(native_event));
+ // Non-client message. The position is contained in a POINTS structure in
+ // LPARAM, and is in screen coordinates so we have to convert to client.
+ POINT native_point = { GET_X_LPARAM(native_event.lParam),
+ GET_Y_LPARAM(native_event.lParam) };
+
+ // TODO(erg): The windows folks say the above is done in screen
+ // coordinates. Is that equivalent to root coordinates on windows?
Elliot Glaysher 2012/05/09 19:39:18 attn ben: is this correct for window?
+ return gfx::Point(native_point);
+}
+
KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
return KeyboardCodeForWindowsKeyCode(native_event.wParam);
}

Powered by Google App Engine
This is Rietveld 408576698