Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1694)

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 2695103003: Fix the position of context menu for BrowserPlugins inside OOPIF (Merge to M-57) (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_view_guest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index bf00133939ade5f614435343523eec7634106a66..504aeb80a246bef8867feb15425920102923a34d 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -391,9 +391,13 @@ void BrowserPlugin::updateGeometry(const WebRect& plugin_rect_in_viewport,
gfx::Rect old_view_rect = view_rect_;
// Convert the plugin_rect_in_viewport to window coordinates, which is css.
WebRect rect_in_css(plugin_rect_in_viewport);
- blink::WebView* webview = container()->document().frame()->view();
- RenderViewImpl::FromWebView(webview)->GetWidget()->convertViewportToWindow(
- &rect_in_css);
+
+ // We will use the local root's RenderWidget to convert coordinates to Window.
+ // If this local root belongs to an OOPIF, on the browser side we will have to
+ // consider the displacement of the child frame in root window.
+ RenderFrameImpl::FromWebFrame(container()->document().frame())
+ ->GetRenderWidget()
+ ->convertViewportToWindow(&rect_in_css);
view_rect_ = rect_in_css;
if (!ready_) {
« no previous file with comments | « content/browser/web_contents/web_contents_view_guest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698