From cf06a4ae0a4313622ffcecc6a3520405128d230d Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Wed, 2 Mar 2011 18:43:01 +0000 Subject: Inform the browser about mouse input in windowed plugins to ensure that we expect actions which correspond to user gesture like downloads, external protocol launches, etc. Actions occurring in the context of user input need to be allowed. To achieve this we send over the WM_PARENTNOTIFY message to the RVH window which turns on user gesture. As per msdn this message should be received automatically which does not appear to be the case. All this means that we trust the plugin. However this does not add a new attack vector as the plugin can send messages to other windows in the desktop anyway. Fixes bug http://code.google.com/p/chromium/issues/detail?id=41157 BUG=41157 TEST=As described in the bug. Review URL: http://codereview.chromium.org/6592092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76566 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/renderer_host/render_widget_host.cc | 5 +++++ content/browser/renderer_host/render_widget_host.h | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'content') diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc index 2d081d5..f6daf41 100644 --- a/content/browser/renderer_host/render_widget_host.cc +++ b/content/browser/renderer_host/render_widget_host.cc @@ -1285,3 +1285,8 @@ void RenderWidgetHost::ActivateDeferredPluginHandles() { deferred_plugin_handles_.clear(); } + +void RenderWidgetHost::StartUserGesture() { + OnUserGesture(); +} + diff --git a/content/browser/renderer_host/render_widget_host.h b/content/browser/renderer_host/render_widget_host.h index d3598dd..149f5f9 100644 --- a/content/browser/renderer_host/render_widget_host.h +++ b/content/browser/renderer_host/render_widget_host.h @@ -395,6 +395,10 @@ class RenderWidgetHost : public IPC::Channel::Listener, const gfx::Point& last_scroll_offset() const { return last_scroll_offset_; } + // Notification that the user has made some kind of input that could + // perform an action. See OnUserGesture for more details. + void StartUserGesture(); + protected: // Internal implementation of the public Forward*Event() methods. void ForwardInputEvent(const WebKit::WebInputEvent& input_event, -- cgit v1.1