cef/libcef_dll/cpptoc/browser_host_cpptoc.cc

237 lines
6.5 KiB
C++

// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// 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.
//
#include "libcef_dll/cpptoc/browser_cpptoc.h"
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
#include "libcef_dll/ctocpp/client_ctocpp.h"
// GLOBAL FUNCTIONS - Body may be edited by hand.
CEF_EXPORT int cef_browser_host_create_browser(
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
const cef_string_t* url, const struct _cef_browser_settings_t* settings) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: windowInfo; type: struct_byref_const
DCHECK(windowInfo);
if (!windowInfo)
return 0;
// Verify param: client; type: refptr_diff
DCHECK(client);
if (!client)
return 0;
// Verify param: settings; type: struct_byref_const
DCHECK(settings);
if (!settings)
return 0;
// Unverified params: url
// Translate param: windowInfo; type: struct_byref_const
CefWindowInfo windowInfoObj;
if (windowInfo)
windowInfoObj.Set(*windowInfo, false);
// Translate param: settings; type: struct_byref_const
CefBrowserSettings settingsObj;
if (settings)
settingsObj.Set(*settings, false);
// Execute
bool _retval = CefBrowserHost::CreateBrowser(
windowInfoObj,
CefClientCToCpp::Wrap(client),
CefString(url),
settingsObj);
// Return type: bool
return _retval;
}
CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
const cef_string_t* url, const struct _cef_browser_settings_t* settings) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: windowInfo; type: struct_byref_const
DCHECK(windowInfo);
if (!windowInfo)
return NULL;
// Verify param: client; type: refptr_diff
DCHECK(client);
if (!client)
return NULL;
// Verify param: settings; type: struct_byref_const
DCHECK(settings);
if (!settings)
return NULL;
// Unverified params: url
// Translate param: windowInfo; type: struct_byref_const
CefWindowInfo windowInfoObj;
if (windowInfo)
windowInfoObj.Set(*windowInfo, false);
// Translate param: settings; type: struct_byref_const
CefBrowserSettings settingsObj;
if (settings)
settingsObj.Set(*settings, false);
// Execute
CefRefPtr<CefBrowser> _retval = CefBrowserHost::CreateBrowserSync(
windowInfoObj,
CefClientCToCpp::Wrap(client),
CefString(url),
settingsObj);
// Return type: refptr_same
return CefBrowserCppToC::Wrap(_retval);
}
// MEMBER FUNCTIONS - Body may be edited by hand.
cef_browser_t* CEF_CALLBACK browser_host_get_browser(
struct _cef_browser_host_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefBrowser> _retval = CefBrowserHostCppToC::Get(self)->GetBrowser();
// Return type: refptr_same
return CefBrowserCppToC::Wrap(_retval);
}
void CEF_CALLBACK browser_host_parent_window_will_close(
struct _cef_browser_host_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefBrowserHostCppToC::Get(self)->ParentWindowWillClose();
}
void CEF_CALLBACK browser_host_close_browser(struct _cef_browser_host_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefBrowserHostCppToC::Get(self)->CloseBrowser();
}
void CEF_CALLBACK browser_host_set_focus(struct _cef_browser_host_t* self,
int enable) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefBrowserHostCppToC::Get(self)->SetFocus(
enable?true:false);
}
cef_window_handle_t CEF_CALLBACK browser_host_get_window_handle(
struct _cef_browser_host_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
cef_window_handle_t _retval = CefBrowserHostCppToC::Get(
self)->GetWindowHandle();
// Return type: simple
return _retval;
}
cef_window_handle_t CEF_CALLBACK browser_host_get_opener_window_handle(
struct _cef_browser_host_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
cef_window_handle_t _retval = CefBrowserHostCppToC::Get(
self)->GetOpenerWindowHandle();
// Return type: simple
return _retval;
}
struct _cef_client_t* CEF_CALLBACK browser_host_get_client(
struct _cef_browser_host_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefClient> _retval = CefBrowserHostCppToC::Get(self)->GetClient();
// Return type: refptr_diff
return CefClientCToCpp::Unwrap(_retval);
}
cef_string_userfree_t CEF_CALLBACK browser_host_get_dev_tools_url(
struct _cef_browser_host_t* self, int http_scheme) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefBrowserHostCppToC::Get(self)->GetDevToolsURL(
http_scheme?true:false);
// Return type: string
return _retval.DetachToUserFree();
}
// CONSTRUCTOR - Do not edit by hand.
CefBrowserHostCppToC::CefBrowserHostCppToC(CefBrowserHost* cls)
: CefCppToC<CefBrowserHostCppToC, CefBrowserHost, cef_browser_host_t>(cls) {
struct_.struct_.get_browser = browser_host_get_browser;
struct_.struct_.parent_window_will_close =
browser_host_parent_window_will_close;
struct_.struct_.close_browser = browser_host_close_browser;
struct_.struct_.set_focus = browser_host_set_focus;
struct_.struct_.get_window_handle = browser_host_get_window_handle;
struct_.struct_.get_opener_window_handle =
browser_host_get_opener_window_handle;
struct_.struct_.get_client = browser_host_get_client;
struct_.struct_.get_dev_tools_url = browser_host_get_dev_tools_url;
}
#ifndef NDEBUG
template<> long CefCppToC<CefBrowserHostCppToC, CefBrowserHost,
cef_browser_host_t>::DebugObjCt = 0;
#endif