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

Unified Diff: ui/views/widget/native_widget_win.cc

Issue 6756043: Consolidate Widget Event code, other cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional code consolidation, move base defs, nix MakeMSG, TooltipManager cleanup, etc. Created 9 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
Index: ui/views/widget/native_widget_win.cc
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index ac6cfed90f3a7520b2cf971790390928cd9fe816..0d2d998581729add98089dc365cf530851887080 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -349,15 +349,13 @@ void NativeWidgetWin::OnInitMenuPopup(HMENU menu, UINT position,
LRESULT NativeWidgetWin::OnKeyDown(UINT message, WPARAM w_param,
LPARAM l_param) {
- MSG msg;
- MakeMSG(&msg, message, w_param, l_param);
+ MSG msg = { message, w_param, l_param };
SetMsgHandled(listener_->OnKeyEvent(KeyEvent(msg)));
return 0;
}
LRESULT NativeWidgetWin::OnKeyUp(UINT message, WPARAM w_param, LPARAM l_param) {
- MSG msg;
- MakeMSG(&msg, message, w_param, l_param);
+ MSG msg = { message, w_param, l_param };
SetMsgHandled(listener_->OnKeyEvent(KeyEvent(msg)));
return 0;
}
@@ -376,8 +374,7 @@ LRESULT NativeWidgetWin::OnMouseActivate(HWND window, UINT hittest_code,
LRESULT NativeWidgetWin::OnMouseLeave(UINT message, WPARAM w_param,
LPARAM l_param) {
// TODO(beng): tooltip
- MSG msg;
- MakeMSG(&msg, message, w_param, l_param);
+ MSG msg = { message, w_param, l_param };
SetMsgHandled(listener_->OnMouseEvent(MouseEvent(msg)));
// Reset our tracking flag so that future mouse movement over this WidgetWin
@@ -594,8 +591,7 @@ void NativeWidgetWin::TrackMouseEvents(DWORD mouse_tracking_flags) {
bool NativeWidgetWin::ProcessMouseRange(UINT message, WPARAM w_param,
LPARAM l_param, bool non_client) {
- MSG msg;
- MakeMSG(&msg, message, w_param, l_param);
+ MSG msg = { message, w_param, l_param };
if (message == WM_MOUSEWHEEL) {
// Reroute the mouse-wheel to the window under the mouse pointer if
// applicable.
@@ -612,17 +608,6 @@ bool NativeWidgetWin::ProcessMouseRange(UINT message, WPARAM w_param,
return listener_->OnMouseEvent(MouseEvent(msg));
}
-void NativeWidgetWin::MakeMSG(MSG* msg, UINT message, WPARAM w_param,
- LPARAM l_param, DWORD time, LONG x, LONG y) const {
- msg->hwnd = hwnd();
- msg->message = message;
- msg->wParam = w_param;
- msg->lParam = l_param;
- msg->time = time;
- msg->pt.x = x;
- msg->pt.y = y;
-}
-
void NativeWidgetWin::CloseNow() {
DestroyWindow(hwnd());
}

Powered by Google App Engine
This is Rietveld 408576698