mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Auto-generate all C/C++ translation code (issue #33).
- Change index parameter types from int to size_t to make 0-based range implicit. - Make CefPrintOptions and CefMenuInfo proper wrapper classes. - Normalize the naming of menu-related types. - Remove unused command_line variable from test_suite.cc. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@408 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -4,8 +4,8 @@
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// A portion of this file was generated by the CEF translator tool. When
|
||||
// making changes by hand only do so within the body of existing function
|
||||
// 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
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
@ -23,105 +23,168 @@ int CEF_CALLBACK life_span_handler_on_before_popup(
|
||||
cef_window_info_t* windowInfo, const cef_string_t* url,
|
||||
struct _cef_client_t** client, struct _cef_browser_settings_t* settings)
|
||||
{
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: parentBrowser; type: refptr_diff
|
||||
DCHECK(parentBrowser);
|
||||
if (!parentBrowser)
|
||||
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: url; type: string_byref_const
|
||||
DCHECK(url);
|
||||
if (!url)
|
||||
return 0;
|
||||
// Verify param: client; type: refptr_same_byref
|
||||
DCHECK(client);
|
||||
if (!client)
|
||||
return 0;
|
||||
// Verify param: settings; type: struct_byref
|
||||
DCHECK(settings);
|
||||
if (!self || !parentBrowser || !popupFeatures || !windowInfo || !client ||
|
||||
!settings)
|
||||
if (!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.
|
||||
// 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
|
||||
CefRefPtr<CefClient> clientPtr;
|
||||
if (*client)
|
||||
if (client && *client)
|
||||
clientPtr = CefClientCppToC::Unwrap(*client);
|
||||
CefClient* origClient = clientPtr.get();
|
||||
CefClient* clientOrig = clientPtr.get();
|
||||
// Translate param: settings; type: struct_byref
|
||||
CefBrowserSettings settingsObj;
|
||||
if (settings)
|
||||
settingsObj.AttachTo(*settings);
|
||||
|
||||
// |parentBrowser| will be NULL if this is a top-level browser window.
|
||||
CefRefPtr<CefBrowser> browserPtr(CefBrowserCToCpp::Wrap(parentBrowser));
|
||||
// Execute
|
||||
bool _retval = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
|
||||
CefBrowserCToCpp::Wrap(parentBrowser),
|
||||
popupFeaturesObj,
|
||||
windowInfoObj,
|
||||
CefString(url),
|
||||
clientPtr,
|
||||
settingsObj);
|
||||
|
||||
bool rv = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
|
||||
browserPtr, features, wndInfo, CefString(url), clientPtr,
|
||||
browserSettings);
|
||||
|
||||
if (clientPtr.get()) {
|
||||
if (clientPtr.get() != origClient) {
|
||||
// The handler has been changed.
|
||||
*client = CefClientCppToC::Wrap(clientPtr);
|
||||
// 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;
|
||||
}
|
||||
} else {
|
||||
*client = NULL;
|
||||
}
|
||||
// Restore param: settings; type: struct_byref
|
||||
if (settings)
|
||||
settingsObj.DetachTo(*settings);
|
||||
|
||||
// Return the values to the structures.
|
||||
wndInfo.DetachTo(*windowInfo);
|
||||
browserSettings.DetachTo(*settings);
|
||||
|
||||
return rv;
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
|
||||
void CEF_CALLBACK life_span_handler_on_after_created(
|
||||
struct _cef_life_span_handler_t* self, cef_browser_t* browser)
|
||||
{
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!self || !browser)
|
||||
if (!browser)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefLifeSpanHandlerCppToC::Get(self)->OnAfterCreated(
|
||||
CefBrowserCToCpp::Wrap(browser));
|
||||
}
|
||||
|
||||
|
||||
int CEF_CALLBACK life_span_handler_run_modal(
|
||||
struct _cef_life_span_handler_t* self, cef_browser_t* browser)
|
||||
{
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!self || !browser)
|
||||
if (!browser)
|
||||
return 0;
|
||||
|
||||
return CefLifeSpanHandlerCppToC::Get(self)->RunModal(
|
||||
// Execute
|
||||
bool _retval = CefLifeSpanHandlerCppToC::Get(self)->RunModal(
|
||||
CefBrowserCToCpp::Wrap(browser));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
|
||||
int CEF_CALLBACK life_span_handler_do_close(
|
||||
struct _cef_life_span_handler_t* self, cef_browser_t* browser)
|
||||
{
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!self || !browser)
|
||||
if (!browser)
|
||||
return 0;
|
||||
|
||||
return CefLifeSpanHandlerCppToC::Get(self)->DoClose(
|
||||
// Execute
|
||||
bool _retval = CefLifeSpanHandlerCppToC::Get(self)->DoClose(
|
||||
CefBrowserCToCpp::Wrap(browser));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
|
||||
void CEF_CALLBACK life_span_handler_on_before_close(
|
||||
struct _cef_life_span_handler_t* self, cef_browser_t* browser)
|
||||
{
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!self || !browser)
|
||||
if (!browser)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefLifeSpanHandlerCppToC::Get(self)->OnBeforeClose(
|
||||
CefBrowserCToCpp::Wrap(browser));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls)
|
||||
|
Reference in New Issue
Block a user