summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 19:16:02 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 19:16:02 +0000
commitea192e83450c3391f03c59219dfc9797e912a0d1 (patch)
tree1a3b36e00cce783a135c2f0edc463eb58ce3e6bd /webkit/plugins
parentdc1e688dc600bd425ad6be0a923c0a6c1d53b6c9 (diff)
downloadchromium_src-ea192e83450c3391f03c59219dfc9797e912a0d1.zip
chromium_src-ea192e83450c3391f03c59219dfc9797e912a0d1.tar.gz
chromium_src-ea192e83450c3391f03c59219dfc9797e912a0d1.tar.bz2
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
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.cc1
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.h1
-rw-r--r--webkit/plugins/ppapi/plugin_delegate.h3
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.h4
-rw-r--r--webkit/plugins/ppapi/ppb_flash_menu_impl.cc3
5 files changed, 9 insertions, 3 deletions
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<PluginInstance> {
// 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(