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

Unified Diff: chrome/views/controls/text_field.cc

Issue 73087: Make TextFields reroute mouse wheel messages (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 | chrome/views/view_unittest.cc » ('j') | chrome/views/view_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/controls/text_field.cc
===================================================================
--- chrome/views/controls/text_field.cc (revision 13748)
+++ chrome/views/controls/text_field.cc (working copy)
@@ -24,6 +24,7 @@
#include "chrome/common/win_util.h"
#include "chrome/views/controls/hwnd_view.h"
#include "chrome/views/controls/menu/menu.h"
+#include "chrome/views/focus/focus_util_win.h"
#include "chrome/views/widget/widget.h"
#include "grit/generated_resources.h"
#include "skia/ext/skia_utils_win.h"
@@ -83,6 +84,7 @@
MSG_WM_MBUTTONDOWN(OnNonLButtonDown)
MSG_WM_MOUSEMOVE(OnMouseMove)
MSG_WM_MOUSELEAVE(OnMouseLeave)
+ MESSAGE_HANDLER_EX(WM_MOUSEWHEEL, OnMouseWheel)
MSG_WM_NCCALCSIZE(OnNCCalcSize)
MSG_WM_NCPAINT(OnNCPaint)
MSG_WM_RBUTTONDOWN(OnNonLButtonDown)
@@ -130,6 +132,7 @@
void OnLButtonDown(UINT keys, const CPoint& point);
void OnLButtonUp(UINT keys, const CPoint& point);
void OnMouseLeave();
+ LRESULT OnMouseWheel(UINT message, WPARAM w_param, LPARAM l_param);
void OnMouseMove(UINT keys, const CPoint& point);
int OnNCCalcSize(BOOL w_param, LPARAM l_param);
void OnNCPaint(HRGN region);
@@ -626,6 +629,15 @@
SetContainsMouse(false);
}
+LRESULT TextField::Edit::OnMouseWheel(UINT message,
+ WPARAM w_param, LPARAM l_param) {
+ // Reroute the mouse-wheel to the window under the mouse pointer if
+ // applicable.
+ if (views::RerouteMouseWheel(m_hWnd, w_param, l_param))
+ return 0;
+ return DefWindowProc(message, w_param, l_param);;
+}
+
void TextField::Edit::OnMouseMove(UINT keys, const CPoint& point) {
SetContainsMouse(true);
// Clamp the selection to the visible text so the user can't drag to select
« no previous file with comments | « no previous file | chrome/views/view_unittest.cc » ('j') | chrome/views/view_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698