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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 2544223002: Fix the position of context menu for BrowserPlugins inside OOPIF (Closed)
Patch Set: Use attach params for initializing |guest_window_rect_| Created 4 years 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 | « no previous file | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d4d4f14d881c1e6f02b7efe8578dc5bbd3785819..c8af73bf03c9f3a3087b7c325ab94b4f62d55042 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -363,6 +363,11 @@ void BrowserPluginGuest::InitInternal(
GetWebContents()->GetRenderViewHost()->GetWebkitPreferences();
prefs.navigate_on_drag_drop = false;
GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs);
+
+ if (auto* owner_rwhv = GetOwnerRenderWidgetHostView()) {
+ guest_window_rect_.set_origin(owner_rwhv->TransformPointToRootCoordSpace(
+ guest_window_rect_.origin()));
+ }
}
BrowserPluginGuest::~BrowserPluginGuest() {
@@ -1002,6 +1007,11 @@ void BrowserPluginGuest::OnUpdateGeometry(int browser_plugin_instance_id,
// The plugin has moved within the embedder without resizing or the
// embedder/container's view rect changing.
guest_window_rect_ = view_rect;
+ if (auto* rwhv = GetOwnerRenderWidgetHostView()) {
+ guest_window_rect_.set_origin(
+ rwhv->TransformPointToRootCoordSpace(guest_window_rect_.origin()));
+ }
+
GetWebContents()->SendScreenRects();
}
« no previous file with comments | « no previous file | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698