From ea192e83450c3391f03c59219dfc9797e912a0d1 Mon Sep 17 00:00:00 2001 From: "yzshen@chromium.org" Date: Mon, 11 Apr 2011 19:16:02 +0000 Subject: Fix the issue that context menu doesn't show on fullscreen Pepper Flash. - generate WebInputEvent::ContextMenu events. - calculate the context menu position correctly. - monitor mouse down events on fullscreen render widget, so that we can pass correct timestamp to gtk_menu_popup. BUG=None. TEST=Open a fullscreen Youtube video, and right click on it to see whether context menu shows up or not. Review URL: http://codereview.chromium.org/6760019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81135 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/plugins/ppapi/mock_plugin_delegate.cc | 1 + webkit/plugins/ppapi/mock_plugin_delegate.h | 1 + webkit/plugins/ppapi/plugin_delegate.h | 3 ++- webkit/plugins/ppapi/ppapi_plugin_instance.h | 4 ++++ webkit/plugins/ppapi/ppb_flash_menu_impl.cc | 3 +-- 5 files changed, 9 insertions(+), 3 deletions(-) (limited to 'webkit/plugins') diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc index 5376483..388b6af 100644 --- a/webkit/plugins/ppapi/mock_plugin_delegate.cc +++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc @@ -181,6 +181,7 @@ int32_t MockPluginDelegate::ConnectTcpAddress( } int32_t MockPluginDelegate::ShowContextMenu( + PluginInstance* instance, webkit::ppapi::PPB_Flash_Menu_Impl* menu, const gfx::Point& position) { return PP_ERROR_FAILED; diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h index 754282f7..ce172a0 100644 --- a/webkit/plugins/ppapi/mock_plugin_delegate.h +++ b/webkit/plugins/ppapi/mock_plugin_delegate.h @@ -83,6 +83,7 @@ class MockPluginDelegate : public PluginDelegate { webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, const struct PP_Flash_NetAddress* addr); virtual int32_t ShowContextMenu( + PluginInstance* instance, webkit::ppapi::PPB_Flash_Menu_Impl* menu, const gfx::Point& position); virtual FullscreenContainer* CreateFullscreenContainer( diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h index 6349cd9..62ad9c1 100644 --- a/webkit/plugins/ppapi/plugin_delegate.h +++ b/webkit/plugins/ppapi/plugin_delegate.h @@ -328,9 +328,10 @@ class PluginDelegate { webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, const struct PP_Flash_NetAddress* addr) = 0; - // Show the given context menu at the given position (in the render view's + // Show the given context menu at the given position (in the plugin's // coordinates). virtual int32_t ShowContextMenu( + PluginInstance* instance, webkit::ppapi::PPB_Flash_Menu_Impl* menu, const gfx::Point& position) = 0; diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h index 35968bb..f60dc88 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.h +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h @@ -254,6 +254,10 @@ class PluginInstance : public base::RefCounted { // embedded in a page). bool IsFullPagePlugin() const; + FullscreenContainer* fullscreen_container() const { + return fullscreen_container_; + } + private: bool LoadFindInterface(); bool LoadMessagingInterface(); diff --git a/webkit/plugins/ppapi/ppb_flash_menu_impl.cc b/webkit/plugins/ppapi/ppb_flash_menu_impl.cc index 52f81b6..d147996 100644 --- a/webkit/plugins/ppapi/ppb_flash_menu_impl.cc +++ b/webkit/plugins/ppapi/ppb_flash_menu_impl.cc @@ -176,8 +176,7 @@ int32_t PPB_Flash_Menu_Impl::Show(const PP_Point* location, } int32_t rv = instance()->delegate()->ShowContextMenu( - this, gfx::Point(instance()->position().x() + location->x, - instance()->position().y() + location->y)); + instance(), this, gfx::Point(location->x, location->y)); if (rv == PP_ERROR_WOULDBLOCK) { // Record callback and output buffers. callback_ = new TrackedCompletionCallback( -- cgit v1.1