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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.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
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 97ea0475fc3176c9aa7a1d99d4152c5005b901cb..290514b324db47c4e33319ca48a0fce9a0faa31f 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -485,6 +485,21 @@ void BrowserPluginGuest::ResendEventToEmbedder(
}
}
+gfx::Point BrowserPluginGuest::GetCoordinatesInEmbedderWebContents(
+ const gfx::Point& relative_point) {
+ RenderWidgetHostView* owner_rwhv = GetOwnerRenderWidgetHostView();
+ if (!owner_rwhv)
+ return relative_point;
+
+ gfx::Point point(relative_point);
+
+ // Add the offset form the embedder web contents view.
+ point +=
+ owner_rwhv->TransformPointToRootCoordSpace(guest_window_rect_.origin())
+ .OffsetFromOrigin();
+ return point;
+}
+
WebContentsImpl* BrowserPluginGuest::GetWebContents() const {
return static_cast<WebContentsImpl*>(web_contents());
}
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/browser/web_contents/web_contents_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698