summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-15 00:10:09 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-15 00:10:09 +0000
commit8e14284ed88d453f7ae280f033fffe7bcd6d8450 (patch)
tree3d1c5ef57ba393c3782f3095061a948b70f93f3e /chrome
parent573ef318ab6f9116139419745d741765ff4bb910 (diff)
downloadchromium_src-8e14284ed88d453f7ae280f033fffe7bcd6d8450.zip
chromium_src-8e14284ed88d453f7ae280f033fffe7bcd6d8450.tar.gz
chromium_src-8e14284ed88d453f7ae280f033fffe7bcd6d8450.tar.bz2
Set disabled style on GPU window and plugin intermediate window so mouse messages pass through to the browser window.
TEST=trybots BUG=none Review URL: http://codereview.chromium.org/549025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36311 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc8
-rw-r--r--chrome/plugin/webplugin_proxy.h6
-rw-r--r--chrome/renderer/webplugin_delegate_pepper.cc2
3 files changed, 15 insertions, 1 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 d6287ac..0fa926d 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -440,10 +440,16 @@ HWND RenderWidgetHostViewWin::ReparentWindow(HWND window) {
}
DCHECK(window_class);
+ // TODO(apatrick): the parent window is disabled if the plugin window is
+ // disabled so that mouse messages from the plugin window are passed on to the
+ // browser window. This does not work for regular plugins because it prevents
+ // them from receiving mouse and keyboard input. WS_DISABLED is not
+ // needed when the GPU process stops using child windows for 3D rendering.
+ DWORD enabled_style = ::GetWindowLong(window, GWL_STYLE) & WS_DISABLED;
HWND parent = CreateWindowEx(
WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR,
MAKEINTATOM(window_class), 0,
- WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
+ WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | enabled_style,
0, 0, 0, 0, ::GetParent(window), 0, GetModuleHandle(NULL), 0);
DCHECK(parent);
::SetParent(window, parent);
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 2e86bbd..4a91685 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -42,6 +42,12 @@ class WebPluginProxy : public webkit_glue::WebPlugin {
// WebPlugin overrides
void SetWindow(gfx::PluginWindowHandle window);
+
+ // Whether input events should be sent to the delegate.
+ virtual void SetAcceptsInputEvents(bool accepts) {
+ NOTREACHED();
+ }
+
void WillDestroyWindow(gfx::PluginWindowHandle window);
#if defined(OS_WIN)
void SetWindowlessPumpEvent(HANDLE pump_messages_event);
diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc
index 77c9146..e2c62a1 100644
--- a/chrome/renderer/webplugin_delegate_pepper.cc
+++ b/chrome/renderer/webplugin_delegate_pepper.cc
@@ -431,6 +431,8 @@ NPError WebPluginDelegatePepper::Device3DInitializeContext(
std::vector<std::string>(),
plugin_,
false)) {
+ plugin_->SetAcceptsInputEvents(true);
+
// Ask the GPU plugin to create a command buffer and return a proxy.
command_buffer_.reset(nested_delegate_->CreateCommandBuffer());
if (command_buffer_.get()) {