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(popupFeatures);
|
||||
DCHECK(windowInfo);
|
||||
DCHECK(url);
|
||||
DCHECK(client);
|
||||
DCHECK(settings);
|
||||
if (!self || !parentBrowser || !popupFeatures || !windowInfo || !url ||
|
||||
!client || !settings)
|
||||
if (!self || !parentBrowser || !popupFeatures || !windowInfo || !client ||
|
||||
!settings)
|
||||
return 0;
|
||||
|
||||
CefWindowInfo wndInfo;
|
||||
CefBrowserSettings browserSettings;
|
||||
CefPopupFeatures features;
|
||||
|
||||
|
||||
// Take ownership of the values.
|
||||
wndInfo.AttachTo(*windowInfo);
|
||||
browserSettings.AttachTo(*settings);
|
||||
|
||||
|
||||
// Reference the existing values instead of copying.
|
||||
features.Set(*popupFeatures, false);
|
||||
|
||||
|
||||
// |newHandler| will start off pointing to the current handler.
|
||||
CefRefPtr<CefClient> clientPtr;
|
||||
if (*client)
|
||||
clientPtr = CefClientCppToC::Unwrap(*client);
|
||||
CefClient* origClient = clientPtr.get();
|
||||
|
||||
|
||||
// |parentBrowser| will be NULL if this is a top-level browser window.
|
||||
CefRefPtr<CefBrowser> browserPtr(CefBrowserCToCpp::Wrap(parentBrowser));
|
||||
|
||||
|
||||
bool rv = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
|
||||
browserPtr, features, wndInfo, CefString(url), clientPtr,
|
||||
browserSettings);
|
||||
|
|
Loading…
Reference in New Issue