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

Unified Diff: content/browser/web_contents/web_contents_view_guest.cc

Issue 490293003: Fix <webview> context menu positioning on mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_guest.cc
diff --git a/content/browser/web_contents/web_contents_view_guest.cc b/content/browser/web_contents/web_contents_view_guest.cc
index c8946fcc2298bc2f9609f91a1d2b3c676a1899da..efa92bdc0ee4ae7421bf6e52c1c51dc31371b905 100644
--- a/content/browser/web_contents/web_contents_view_guest.cc
+++ b/content/browser/web_contents/web_contents_view_guest.cc
@@ -73,12 +73,8 @@ void WebContentsViewGuest::OnGuestInitialized(WebContentsView* parent_view) {
ContextMenuParams WebContentsViewGuest::ConvertContextMenuParams(
const ContextMenuParams& params) const {
-#if defined(USE_AURA)
- // Context menu uses ScreenPositionClient::ConvertPointToScreen() in aura
- // to calculate popup position. Guest's native view
- // (platform_view_->GetNativeView()) is part of the embedder's view hierarchy,
- // but is placed at (0, 0) w.r.t. the embedder's position. Therefore, |offset|
- // is added to |params|.
+ // We need to add |offset| of the guest from the embedder to position the
+ // menu properly.
gfx::Rect embedder_bounds;
guest_->embedder_web_contents()->GetView()->GetContainerBounds(
&embedder_bounds);
@@ -90,9 +86,6 @@ ContextMenuParams WebContentsViewGuest::ConvertContextMenuParams(
params_in_embedder.x += offset.x();
params_in_embedder.y += offset.y();
return params_in_embedder;
-#else
- return params;
-#endif
}
void WebContentsViewGuest::GetContainerBounds(gfx::Rect* out) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698