diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-15 21:32:17 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-15 21:32:17 +0000 |
commit | 34b96f93f795f1ffc3afa29ad9354597aa986dff (patch) | |
tree | 06f825335a4cdca24e2ffabe19dfaf3909e5b9b1 /chrome/views/controls | |
parent | 36fe5ec1069d47b94713ea699dd132a38436821f (diff) | |
download | chromium_src-34b96f93f795f1ffc3afa29ad9354597aa986dff.zip chromium_src-34b96f93f795f1ffc3afa29ad9354597aa986dff.tar.gz chromium_src-34b96f93f795f1ffc3afa29ad9354597aa986dff.tar.bz2 |
The text-fields were not rerouting mouse-wheel messages, causing the window under the mouse not to scroll when a text-field (such as the find-box) was focused.
BUG=9647
TEST=Navigate to a page long enough to have vertical scroll-bars (ex: http://slashdot.org). CTRL-F to open the find in page box. While the mouse is over the page (but the find in bar text-field has focus) use the mouse scroll-wheel). The page should scroll.
Review URL: http://codereview.chromium.org/73087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13794 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/controls')
-rw-r--r-- | chrome/views/controls/text_field.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/views/controls/text_field.cc b/chrome/views/controls/text_field.cc index 1485427..875453a 100644 --- a/chrome/views/controls/text_field.cc +++ b/chrome/views/controls/text_field.cc @@ -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 @@ class TextField::Edit 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 @@ class TextField::Edit 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 @@ void TextField::Edit::OnMouseLeave() { 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 |