summaryrefslogtreecommitdiffstats
path: root/content/renderer/pepper
diff options
context:
space:
mode:
authormiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-06 13:02:06 +0000
committermiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-06 13:02:06 +0000
commitade834714a88b886e4a69959d027e188acb48fc2 (patch)
tree7c40997829f21398c7476dd544e3dfbf58d7d779 /content/renderer/pepper
parent1286c0b07c6c17ecda243f912bde1b5d3a72c48f (diff)
downloadchromium_src-ade834714a88b886e4a69959d027e188acb48fc2.zip
chromium_src-ade834714a88b886e4a69959d027e188acb48fc2.tar.gz
chromium_src-ade834714a88b886e4a69959d027e188acb48fc2.tar.bz2
Fix Flash fullscreen context menu target and position.
This resolves two problems regarding the right-click context menu for Flash fullscreen widgets. First, the WebContentsViewDelegate implementations (for Views and Cocoa) were assuming the event target for the context menu click is always the widget provided by WebContentsView. Flash fullscreen is actually a separate widget. Second, the renderer was trying to be "too smart" by computing the screen coordinates of the context menu itself. This is fixed by removing the offset calculation, which allows the coordinates to be cleanly translated by the windowing toolkit, browser-side. BUG=348965 TEST=Repro steps in bug 348965 result in expected behavior. Review URL: https://codereview.chromium.org/183973027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/pepper')
-rw-r--r--content/renderer/pepper/renderer_ppapi_host_impl.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index 5014c98..afb5f12 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -203,18 +203,10 @@ gfx::Point RendererPpapiHostImpl::PluginPointToRenderFrame(
PP_Instance instance,
const gfx::Point& pt) const {
PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance);
- if (!plugin_instance)
+ if (!plugin_instance || plugin_instance->flash_fullscreen()) {
+ // Flash fullscreen is special in that it renders into its own separate,
+ // dedicated window. So, do not offset the point.
return pt;
-
- RenderFrameImpl* render_frame = static_cast<RenderFrameImpl*>(
- GetRenderFrameForInstance(instance));
- if (plugin_instance->view_data().is_fullscreen ||
- plugin_instance->flash_fullscreen()) {
- blink::WebRect window_rect = render_frame->GetRenderWidget()->windowRect();
- blink::WebRect screen_rect =
- render_frame->GetRenderWidget()->screenInfo().rect;
- return gfx::Point(pt.x() - window_rect.x + screen_rect.x,
- pt.y() - window_rect.y + screen_rect.y);
}
return gfx::Point(pt.x() + plugin_instance->view_data().rect.point.x,
pt.y() + plugin_instance->view_data().rect.point.y);