diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-25 23:27:19 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-25 23:27:19 +0000 |
commit | 83a626ae0e1ed70ad24b4e7cd57bf62dba7e8b5c (patch) | |
tree | 15fbbdf92ba4a738828c4ffaee58c589993daf9b /chrome/browser/renderer_host/render_widget_host_view_win.cc | |
parent | 8bfb33faadbe94daae312fc6b9ed83135946d70c (diff) | |
download | chromium_src-83a626ae0e1ed70ad24b4e7cd57bf62dba7e8b5c.zip chromium_src-83a626ae0e1ed70ad24b4e7cd57bf62dba7e8b5c.tar.gz chromium_src-83a626ae0e1ed70ad24b4e7cd57bf62dba7e8b5c.tar.bz2 |
Relanding since it was breaking the Release build (because of missing includes).
Moving the mouse-wheel message rerouting code out of the focus manager.
This is part of the effort of making the focus manager not window specific.
BUG=None
TEST=Make sure mouse-wheel scrolls the Chrome window under the cursor (try with
a Chrome window, the option window, the task manager table) when it is active
and when it is inactive. Also try using the mouse-wheel on a plugin with a
scroll-view (for example
http://java.sun.com/products/plugin/1.4/demos/plugin/jfc/SwingSet2/SwingSet2.html)
when the browser window is not active, the plugin should scroll.
TBR=ben
Review URL: http://codereview.chromium.org/42624
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_widget_host_view_win.cc')
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_win.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index a6b3773..7ee8935 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -25,6 +25,7 @@ #include "chrome/common/render_messages.h" #include "chrome/common/resource_bundle.h" #include "chrome/common/win_util.h" +#include "chrome/views/focus/focus_util_win.h" // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! #include "chrome/views/widget/widget_win.h" #include "grit/webkit_resources.h" @@ -467,6 +468,9 @@ LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { // of a browser process. OnInputLangChange(0, 0); TRACK_HWND_CREATION(m_hWnd); + // Marks that window as supporting mouse-wheel messages rerouting so it is + // scrolled when under the mouse pointer even if inactive. + views::SetWindowSupportsRerouteMouseWheel(m_hWnd); return 0; } @@ -869,6 +873,14 @@ LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam, reinterpret_cast<LPARAM>(toplevel_hwnd)); } + // Forward the mouse-wheel message to the window under the mouse if it belongs + // to us. + if (message == WM_MOUSEWHEEL && + views::RerouteMouseWheel(m_hWnd, wparam, lparam)) { + handled = TRUE; + return 0; + } + // This is a bit of a hack, but will work for now since we don't want to // pollute this object with WebContents-specific functionality... bool handled_by_webcontents = false; |