2013-01-17 19:39:09 +01:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
2011-05-20 16:42:25 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
2011-12-08 02:38:30 +01:00
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
2011-05-20 16:42:25 +02:00
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/client_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
int CEF_CALLBACK life_span_handler_on_before_popup(
|
|
|
|
struct _cef_life_span_handler_t* self, cef_browser_t* parentBrowser,
|
|
|
|
const struct _cef_popup_features_t* popupFeatures,
|
|
|
|
cef_window_info_t* windowInfo, const cef_string_t* url,
|
2012-01-10 00:46:23 +01:00
|
|
|
cef_client_t** client, struct _cef_browser_settings_t* settings) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: parentBrowser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(parentBrowser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!parentBrowser)
|
|
|
|
return 0;
|
|
|
|
// Verify param: popupFeatures; type: struct_byref_const
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(popupFeatures);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!popupFeatures)
|
|
|
|
return 0;
|
|
|
|
// Verify param: windowInfo; type: struct_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(windowInfo);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!windowInfo)
|
|
|
|
return 0;
|
|
|
|
// Verify param: client; type: refptr_same_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(client);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!client)
|
|
|
|
return 0;
|
|
|
|
// Verify param: settings; type: struct_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(settings);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!settings)
|
2011-05-20 16:42:25 +02:00
|
|
|
return 0;
|
2011-12-20 23:07:45 +01:00
|
|
|
// Unverified params: url
|
2011-05-20 16:42:25 +02:00
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: popupFeatures; type: struct_byref_const
|
|
|
|
CefPopupFeatures popupFeaturesObj;
|
|
|
|
if (popupFeatures)
|
|
|
|
popupFeaturesObj.Set(*popupFeatures, false);
|
|
|
|
// Translate param: windowInfo; type: struct_byref
|
|
|
|
CefWindowInfo windowInfoObj;
|
|
|
|
if (windowInfo)
|
|
|
|
windowInfoObj.AttachTo(*windowInfo);
|
|
|
|
// Translate param: client; type: refptr_same_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
CefRefPtr<CefClient> clientPtr;
|
2011-12-08 02:38:30 +01:00
|
|
|
if (client && *client)
|
2011-05-20 16:42:25 +02:00
|
|
|
clientPtr = CefClientCppToC::Unwrap(*client);
|
2011-12-08 02:38:30 +01:00
|
|
|
CefClient* clientOrig = clientPtr.get();
|
|
|
|
// Translate param: settings; type: struct_byref
|
|
|
|
CefBrowserSettings settingsObj;
|
|
|
|
if (settings)
|
|
|
|
settingsObj.AttachTo(*settings);
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
|
|
|
|
CefBrowserCToCpp::Wrap(parentBrowser),
|
|
|
|
popupFeaturesObj,
|
|
|
|
windowInfoObj,
|
|
|
|
CefString(url),
|
|
|
|
clientPtr,
|
|
|
|
settingsObj);
|
|
|
|
|
|
|
|
// Restore param: windowInfo; type: struct_byref
|
|
|
|
if (windowInfo)
|
|
|
|
windowInfoObj.DetachTo(*windowInfo);
|
|
|
|
// Restore param: client; type: refptr_same_byref
|
|
|
|
if (client) {
|
|
|
|
if (clientPtr.get()) {
|
|
|
|
if (clientPtr.get() != clientOrig) {
|
|
|
|
*client = CefClientCppToC::Wrap(clientPtr);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
*client = NULL;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
}
|
2011-12-08 02:38:30 +01:00
|
|
|
// Restore param: settings; type: struct_byref
|
|
|
|
if (settings)
|
|
|
|
settingsObj.DetachTo(*settings);
|
2011-05-20 16:42:25 +02:00
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK life_span_handler_on_after_created(
|
2012-01-10 00:46:23 +01:00
|
|
|
struct _cef_life_span_handler_t* self, cef_browser_t* browser) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
2011-05-20 16:42:25 +02:00
|
|
|
return;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
2011-05-20 16:42:25 +02:00
|
|
|
CefLifeSpanHandlerCppToC::Get(self)->OnAfterCreated(
|
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
|
|
|
}
|
|
|
|
|
2011-08-03 17:35:51 +02:00
|
|
|
int CEF_CALLBACK life_span_handler_run_modal(
|
2012-01-10 00:46:23 +01:00
|
|
|
struct _cef_life_span_handler_t* self, cef_browser_t* browser) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
2011-08-03 17:35:51 +02:00
|
|
|
return 0;
|
2011-05-20 16:42:25 +02:00
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
|
|
|
bool _retval = CefLifeSpanHandlerCppToC::Get(self)->RunModal(
|
2011-05-20 16:42:25 +02:00
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
2011-12-08 02:38:30 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
2011-08-03 17:35:51 +02:00
|
|
|
int CEF_CALLBACK life_span_handler_do_close(
|
2012-01-10 00:46:23 +01:00
|
|
|
struct _cef_life_span_handler_t* self, cef_browser_t* browser) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-06-14 17:09:55 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-06-14 17:09:55 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
2011-06-14 17:09:55 +02:00
|
|
|
return 0;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
|
|
|
bool _retval = CefLifeSpanHandlerCppToC::Get(self)->DoClose(
|
2011-06-14 17:09:55 +02:00
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
2011-12-08 02:38:30 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
2011-06-14 17:09:55 +02:00
|
|
|
}
|
|
|
|
|
2011-08-03 17:35:51 +02:00
|
|
|
void CEF_CALLBACK life_span_handler_on_before_close(
|
2012-01-10 00:46:23 +01:00
|
|
|
struct _cef_life_span_handler_t* self, cef_browser_t* browser) {
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-06-14 17:09:55 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-06-14 17:09:55 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
2011-06-14 17:09:55 +02:00
|
|
|
return;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
2011-08-03 17:35:51 +02:00
|
|
|
CefLifeSpanHandlerCppToC::Get(self)->OnBeforeClose(
|
2011-06-14 17:09:55 +02:00
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
|
|
|
}
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls)
|
|
|
|
: CefCppToC<CefLifeSpanHandlerCppToC, CefLifeSpanHandler,
|
2012-01-10 00:46:23 +01:00
|
|
|
cef_life_span_handler_t>(cls) {
|
2011-05-20 16:42:25 +02:00
|
|
|
struct_.struct_.on_before_popup = life_span_handler_on_before_popup;
|
|
|
|
struct_.struct_.on_after_created = life_span_handler_on_after_created;
|
2011-06-14 17:09:55 +02:00
|
|
|
struct_.struct_.run_modal = life_span_handler_run_modal;
|
2011-08-03 17:35:51 +02:00
|
|
|
struct_.struct_.do_close = life_span_handler_do_close;
|
|
|
|
struct_.struct_.on_before_close = life_span_handler_on_before_close;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
template<> long CefCppToC<CefLifeSpanHandlerCppToC, CefLifeSpanHandler,
|
|
|
|
cef_life_span_handler_t>::DebugObjCt = 0;
|
|
|
|
#endif
|
|
|
|
|