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

Unified Diff: chrome/views/widget/widget_win.cc

Issue 42624: Moving the mouse-wheel processing code out of the FocusManager (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/views/widget/widget_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/widget/widget_win.cc
===================================================================
--- chrome/views/widget/widget_win.cc (revision 12500)
+++ chrome/views/widget/widget_win.cc (working copy)
@@ -14,6 +14,7 @@
#include "chrome/views/accessibility/view_accessibility.h"
#include "chrome/views/controls/native_control_win.h"
#include "chrome/views/fill_layout.h"
+#include "chrome/views/focus/focus_util_win.h"
#include "chrome/views/widget/aero_tooltip_manager.h"
#include "chrome/views/widget/hwnd_notification_source.h"
#include "chrome/views/widget/root_view.h"
@@ -148,6 +149,7 @@
bounds.height(), parent, NULL, NULL, this);
DCHECK(hwnd_);
TRACK_HWND_CREATION(hwnd_);
+ SetWindowSupportsRerouteMouseWheel(hwnd_);
// The window procedure should have set the data for us.
DCHECK(win_util::GetWindowUserData(hwnd_) == this);
@@ -557,12 +559,19 @@
return 0;
}
-LRESULT WidgetWin::OnMouseWheel(UINT flags, short distance,
- const CPoint& point) {
- MouseWheelEvent e(distance,
- point.x,
- point.y,
- Event::ConvertWindowsFlags(flags));
+LRESULT WidgetWin::OnMouseWheel(UINT message, WPARAM w_param, LPARAM l_param) {
+ // Reroute the mouse-wheel to the window under the mouse pointer if
+ // applicable.
+ if (message == WM_MOUSEWHEEL &&
+ views::RerouteMouseWheel(hwnd_, w_param, l_param)) {
+ return 0;
+ }
+
+ int flags = GET_KEYSTATE_WPARAM(w_param);
+ short distance = GET_WHEEL_DELTA_WPARAM(w_param);
+ int x = GET_X_LPARAM(l_param);
+ int y = GET_Y_LPARAM(l_param);
+ MouseWheelEvent e(distance, x, y, Event::ConvertWindowsFlags(flags));
return root_view_->ProcessMouseWheelEvent(e) ? 0 : 1;
}
« no previous file with comments | « chrome/views/widget/widget_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698