summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 21:55:15 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 21:55:15 +0000
commit11c49d070cd2b1468a8224aabfabef24a094a488 (patch)
tree9d4d1ec43fdd406c8c19961b4b8f72da67e79215 /chrome/browser
parent9441db29eee516da2f6409c7b31d056b726078ed (diff)
downloadchromium_src-11c49d070cd2b1468a8224aabfabef24a094a488.zip
chromium_src-11c49d070cd2b1468a8224aabfabef24a094a488.tar.gz
chromium_src-11c49d070cd2b1468a8224aabfabef24a094a488.tar.bz2
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. Review URL: http://codereview.chromium.org/53037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc12
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;