mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix popup window behavioral errors introduced by revision 1085 changes (issue #816).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1093 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -18,10 +18,13 @@
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK life_span_handler_can_create_popup(
|
||||
int CEF_CALLBACK life_span_handler_on_before_popup(
|
||||
struct _cef_life_span_handler_t* self, cef_browser_t* browser,
|
||||
cef_frame_t* frame, const cef_string_t* target_url,
|
||||
const cef_string_t* target_frame_name, int* no_javascript_access) {
|
||||
const cef_string_t* target_frame_name,
|
||||
const struct _cef_popup_features_t* popupFeatures,
|
||||
cef_window_info_t* windowInfo, cef_client_t** client,
|
||||
struct _cef_browser_settings_t* settings, int* no_javascript_access) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
@ -35,65 +38,28 @@ int CEF_CALLBACK life_span_handler_can_create_popup(
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return 0;
|
||||
// Verify param: popupFeatures; type: struct_byref_const
|
||||
DCHECK(popupFeatures);
|
||||
if (!popupFeatures)
|
||||
return 0;
|
||||
// Verify param: windowInfo; type: struct_byref
|
||||
DCHECK(windowInfo);
|
||||
if (!windowInfo)
|
||||
return 0;
|
||||
// Verify param: client; type: refptr_same_byref
|
||||
DCHECK(client);
|
||||
if (!client)
|
||||
return 0;
|
||||
// Verify param: settings; type: struct_byref
|
||||
DCHECK(settings);
|
||||
if (!settings)
|
||||
return 0;
|
||||
// Verify param: no_javascript_access; type: bool_byaddr
|
||||
DCHECK(no_javascript_access);
|
||||
if (!no_javascript_access)
|
||||
return 0;
|
||||
// Unverified params: target_url, target_frame_name
|
||||
|
||||
// Translate param: no_javascript_access; type: bool_byaddr
|
||||
bool no_javascript_accessBool = (
|
||||
no_javascript_access && *no_javascript_access)?true:false;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefLifeSpanHandlerCppToC::Get(self)->CanCreatePopup(
|
||||
CefBrowserCToCpp::Wrap(browser),
|
||||
CefFrameCToCpp::Wrap(frame),
|
||||
CefString(target_url),
|
||||
CefString(target_frame_name),
|
||||
&no_javascript_accessBool);
|
||||
|
||||
// Restore param: no_javascript_access; type: bool_byaddr
|
||||
if (no_javascript_access)
|
||||
*no_javascript_access = no_javascript_accessBool?true:false;
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK life_span_handler_on_before_popup(
|
||||
struct _cef_life_span_handler_t* self, cef_browser_t* browser,
|
||||
const struct _cef_popup_features_t* popupFeatures,
|
||||
cef_window_info_t* windowInfo, const cef_string_t* target_url,
|
||||
const cef_string_t* target_frame_name, cef_client_t** client,
|
||||
struct _cef_browser_settings_t* settings) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
// Verify param: popupFeatures; type: struct_byref_const
|
||||
DCHECK(popupFeatures);
|
||||
if (!popupFeatures)
|
||||
return;
|
||||
// Verify param: windowInfo; type: struct_byref
|
||||
DCHECK(windowInfo);
|
||||
if (!windowInfo)
|
||||
return;
|
||||
// Verify param: client; type: refptr_same_byref
|
||||
DCHECK(client);
|
||||
if (!client)
|
||||
return;
|
||||
// Verify param: settings; type: struct_byref
|
||||
DCHECK(settings);
|
||||
if (!settings)
|
||||
return;
|
||||
// Unverified params: target_url, target_frame_name
|
||||
|
||||
// Translate param: popupFeatures; type: struct_byref_const
|
||||
CefPopupFeatures popupFeaturesObj;
|
||||
if (popupFeatures)
|
||||
@ -111,16 +77,21 @@ void CEF_CALLBACK life_span_handler_on_before_popup(
|
||||
CefBrowserSettings settingsObj;
|
||||
if (settings)
|
||||
settingsObj.AttachTo(*settings);
|
||||
// Translate param: no_javascript_access; type: bool_byaddr
|
||||
bool no_javascript_accessBool = (
|
||||
no_javascript_access && *no_javascript_access)?true:false;
|
||||
|
||||
// Execute
|
||||
CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
|
||||
bool _retval = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
|
||||
CefBrowserCToCpp::Wrap(browser),
|
||||
popupFeaturesObj,
|
||||
windowInfoObj,
|
||||
CefFrameCToCpp::Wrap(frame),
|
||||
CefString(target_url),
|
||||
CefString(target_frame_name),
|
||||
popupFeaturesObj,
|
||||
windowInfoObj,
|
||||
clientPtr,
|
||||
settingsObj);
|
||||
settingsObj,
|
||||
&no_javascript_accessBool);
|
||||
|
||||
// Restore param: windowInfo; type: struct_byref
|
||||
if (windowInfo)
|
||||
@ -138,6 +109,12 @@ void CEF_CALLBACK life_span_handler_on_before_popup(
|
||||
// Restore param: settings; type: struct_byref
|
||||
if (settings)
|
||||
settingsObj.DetachTo(*settings);
|
||||
// Restore param: no_javascript_access; type: bool_byaddr
|
||||
if (no_javascript_access)
|
||||
*no_javascript_access = no_javascript_accessBool?true:false;
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK life_span_handler_on_after_created(
|
||||
@ -220,7 +197,6 @@ void CEF_CALLBACK life_span_handler_on_before_close(
|
||||
CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls)
|
||||
: CefCppToC<CefLifeSpanHandlerCppToC, CefLifeSpanHandler,
|
||||
cef_life_span_handler_t>(cls) {
|
||||
struct_.struct_.can_create_popup = life_span_handler_can_create_popup;
|
||||
struct_.struct_.on_before_popup = life_span_handler_on_before_popup;
|
||||
struct_.struct_.on_after_created = life_span_handler_on_after_created;
|
||||
struct_.struct_.run_modal = life_span_handler_run_modal;
|
||||
|
Reference in New Issue
Block a user