mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Allow for cases where CefBrowserImpl::UIT_CreateBrowser() may fail (issue #322).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@336 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -163,7 +163,7 @@ gfx::NativeWindow CefBrowserImpl::UIT_GetMainWndHandle() {
|
||||
window_info_.m_hWndParent : window_info_.m_hWnd;
|
||||
}
|
||||
|
||||
void CefBrowserImpl::UIT_CreateBrowser(const CefString& url)
|
||||
bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url)
|
||||
{
|
||||
REQUIRE_UIT();
|
||||
Lock();
|
||||
@@ -177,7 +177,14 @@ void CefBrowserImpl::UIT_CreateBrowser(const CefString& url)
|
||||
window_info_.m_x, window_info_.m_y, window_info_.m_nWidth,
|
||||
window_info_.m_nHeight, window_info_.m_hWndParent, window_info_.m_hMenu,
|
||||
::GetModuleHandle(NULL), NULL);
|
||||
|
||||
// It's possible for CreateWindowEx to fail if the parent window was
|
||||
// destroyed between the call to CreateBrowser and the above one.
|
||||
DCHECK(window_info_.m_hWnd != NULL);
|
||||
if (!window_info_.m_hWnd) {
|
||||
Unlock();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window_info_.m_bTransparentPainting &&
|
||||
!(window_info_.m_dwStyle & WS_CHILD)) {
|
||||
@@ -248,6 +255,8 @@ void CefBrowserImpl::UIT_CreateBrowser(const CefString& url)
|
||||
|
||||
if(url.length() > 0)
|
||||
UIT_LoadURL(GetMainFrame(), url);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable)
|
||||
|
Reference in New Issue
Block a user