Chromium Code Reviews| 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( |