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

Unified Diff: chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm

Issue 183973027: Fix Flash fullscreen context menu target and position. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Avi's comments. Created 6 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: chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm
diff --git a/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm b/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm
index b2dd787b01377c3ddb97b834502c9fe564056862..1caeaea540d1de757f16db939fedd8d02cd857eb 100644
--- a/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm
+++ b/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm
@@ -43,18 +43,22 @@ void ChromeWebContentsViewDelegateMac::ShowContextMenu(
// the second mouse event arrives. In this case, |ShowContextMenu()| will
// get called multiple times - if so, don't create another context menu.
// TODO(asvitkine): Fix the renderer so that it doesn't do this.
- content::RenderWidgetHostView* widget_view =
- web_contents_->GetRenderWidgetHostView();
+ content::RenderWidgetHostView* widget_view = GetActiveRenderWidgetHostView();
if (widget_view && widget_view->IsShowingContextMenu())
return;
context_menu_.reset(new RenderViewContextMenuMac(
- render_frame_host,
- params,
- web_contents_->GetView()->GetContentNativeView()));
+ render_frame_host, params, widget_view->GetNativeView()));
imcheng 2014/03/05 20:28:05 Is widget_view guaranteed to be non-null here?
miu 2014/03/05 20:34:12 Yes. This method is being invoked in response to
context_menu_->Init();
}
+content::RenderWidgetHostView*
+ChromeWebContentsViewDelegateMac::GetActiveRenderWidgetHostView() {
+ return web_contents_->GetFullscreenRenderWidgetHostView() ?
+ web_contents_->GetFullscreenRenderWidgetHostView() :
+ web_contents_->GetRenderWidgetHostView();
+}
+
namespace chrome {
content::WebContentsViewDelegate* CreateWebContentsViewDelegate(

Powered by Google App Engine
This is Rietveld 408576698