mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-10 00:50:38 +01:00
Merge revision 1096 changes:
- Fix crash when destroying the browser window while a context menu is displayed. git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1364@1097 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
5e0e7ba01c
commit
1f9f57722a
@ -43,8 +43,10 @@ CefMenuCreator::~CefMenuCreator() {
|
||||
}
|
||||
|
||||
bool CefMenuCreator::IsShowingContextMenu() {
|
||||
content::RenderWidgetHostView* view =
|
||||
browser_->GetWebContents()->GetRenderWidgetHostView();
|
||||
content::WebContents* web_contents = browser_->GetWebContents();
|
||||
if (!web_contents)
|
||||
return false;
|
||||
content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView();
|
||||
return (view && view->IsShowingContextMenu());
|
||||
}
|
||||
|
||||
@ -159,9 +161,12 @@ void CefMenuCreator::MenuWillShow(CefRefPtr<CefMenuModelImpl> source) {
|
||||
if (source.get() != model_.get())
|
||||
return;
|
||||
|
||||
content::WebContents* web_contents = browser_->GetWebContents();
|
||||
if (!web_contents)
|
||||
return;
|
||||
|
||||
// Notify the host before showing the context menu.
|
||||
content::RenderWidgetHostView* view =
|
||||
browser_->GetWebContents()->GetRenderWidgetHostView();
|
||||
content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView();
|
||||
if (view)
|
||||
view->SetShowingContextMenu(true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user