Remove the url check from life_span_handler_on_before_popup because the URL will be NULL when clicking a link with target="_blank" (issue #247).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@244 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
73f4d5a5e6
commit
387b24e382
|
@ -27,33 +27,32 @@ int CEF_CALLBACK life_span_handler_on_before_popup(
|
||||||
DCHECK(parentBrowser);
|
DCHECK(parentBrowser);
|
||||||
DCHECK(popupFeatures);
|
DCHECK(popupFeatures);
|
||||||
DCHECK(windowInfo);
|
DCHECK(windowInfo);
|
||||||
DCHECK(url);
|
|
||||||
DCHECK(client);
|
DCHECK(client);
|
||||||
DCHECK(settings);
|
DCHECK(settings);
|
||||||
if (!self || !parentBrowser || !popupFeatures || !windowInfo || !url ||
|
if (!self || !parentBrowser || !popupFeatures || !windowInfo || !client ||
|
||||||
!client || !settings)
|
!settings)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
CefWindowInfo wndInfo;
|
CefWindowInfo wndInfo;
|
||||||
CefBrowserSettings browserSettings;
|
CefBrowserSettings browserSettings;
|
||||||
CefPopupFeatures features;
|
CefPopupFeatures features;
|
||||||
|
|
||||||
// Take ownership of the values.
|
// Take ownership of the values.
|
||||||
wndInfo.AttachTo(*windowInfo);
|
wndInfo.AttachTo(*windowInfo);
|
||||||
browserSettings.AttachTo(*settings);
|
browserSettings.AttachTo(*settings);
|
||||||
|
|
||||||
// Reference the existing values instead of copying.
|
// Reference the existing values instead of copying.
|
||||||
features.Set(*popupFeatures, false);
|
features.Set(*popupFeatures, false);
|
||||||
|
|
||||||
// |newHandler| will start off pointing to the current handler.
|
// |newHandler| will start off pointing to the current handler.
|
||||||
CefRefPtr<CefClient> clientPtr;
|
CefRefPtr<CefClient> clientPtr;
|
||||||
if (*client)
|
if (*client)
|
||||||
clientPtr = CefClientCppToC::Unwrap(*client);
|
clientPtr = CefClientCppToC::Unwrap(*client);
|
||||||
CefClient* origClient = clientPtr.get();
|
CefClient* origClient = clientPtr.get();
|
||||||
|
|
||||||
// |parentBrowser| will be NULL if this is a top-level browser window.
|
// |parentBrowser| will be NULL if this is a top-level browser window.
|
||||||
CefRefPtr<CefBrowser> browserPtr(CefBrowserCToCpp::Wrap(parentBrowser));
|
CefRefPtr<CefBrowser> browserPtr(CefBrowserCToCpp::Wrap(parentBrowser));
|
||||||
|
|
||||||
bool rv = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
|
bool rv = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
|
||||||
browserPtr, features, wndInfo, CefString(url), clientPtr,
|
browserPtr, features, wndInfo, CefString(url), clientPtr,
|
||||||
browserSettings);
|
browserSettings);
|
||||||
|
|
Loading…
Reference in New Issue