2017-01-11 00:00:30 +01:00
|
|
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +02:00
|
|
|
// 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.
|
|
|
|
//
|
2017-05-17 11:29:28 +02:00
|
|
|
// $hash=a5b87e4e7e656c8643febf4afb3d1bd3f06c7ac0$
|
|
|
|
//
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-01-14 03:45:56 +01:00
|
|
|
#include <algorithm>
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/process_message_cpptoc.h"
|
|
|
|
#include "libcef_dll/transfer_util.h"
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
namespace {
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_browser_host_t* CEF_CALLBACK
|
|
|
|
browser_get_host(struct _cef_browser_t* self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefBrowserHost> _retval = CefBrowserCppToC::Get(self)->GetHost();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBrowserHostCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK browser_can_go_back(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefBrowserCppToC::Get(self)->CanGoBack();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK browser_go_back(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefBrowserCppToC::Get(self)->GoBack();
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK browser_can_go_forward(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefBrowserCppToC::Get(self)->CanGoForward();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK browser_go_forward(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefBrowserCppToC::Get(self)->GoForward();
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK browser_is_loading(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefBrowserCppToC::Get(self)->IsLoading();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK browser_reload(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefBrowserCppToC::Get(self)->Reload();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK browser_reload_ignore_cache(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefBrowserCppToC::Get(self)->ReloadIgnoreCache();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK browser_stop_load(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefBrowserCppToC::Get(self)->StopLoad();
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK browser_get_identifier(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = CefBrowserCppToC::Get(self)->GetIdentifier();
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2012-12-30 12:17:49 +01:00
|
|
|
int CEF_CALLBACK browser_is_same(struct _cef_browser_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_browser_t* that) {
|
2012-12-30 12:17:49 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: that; type: refptr_same
|
|
|
|
DCHECK(that);
|
|
|
|
if (!that)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
bool _retval =
|
|
|
|
CefBrowserCppToC::Get(self)->IsSame(CefBrowserCppToC::Unwrap(that));
|
2012-12-30 12:17:49 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefBrowserCppToC::Get(self)->IsPopup();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefBrowserCppToC::Get(self)->HasDocument();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_frame_t* CEF_CALLBACK
|
|
|
|
browser_get_main_frame(struct _cef_browser_t* self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefFrame> _retval = CefBrowserCppToC::Get(self)->GetMainFrame();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefFrameCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_frame_t* CEF_CALLBACK
|
|
|
|
browser_get_focused_frame(struct _cef_browser_t* self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefFrame> _retval = CefBrowserCppToC::Get(self)->GetFocusedFrame();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefFrameCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_frame_t* CEF_CALLBACK
|
|
|
|
browser_get_frame_byident(struct _cef_browser_t* self, int64 identifier) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefFrame> _retval =
|
|
|
|
CefBrowserCppToC::Get(self)->GetFrame(identifier);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefFrameCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
const cef_string_t* name) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
2014-09-24 17:38:11 +02:00
|
|
|
// Unverified params: name
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefFrame> _retval =
|
|
|
|
CefBrowserCppToC::Get(self)->GetFrame(CefString(name));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefFrameCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t CEF_CALLBACK browser_get_frame_count(struct _cef_browser_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
size_t _retval = CefBrowserCppToC::Get(self)->GetFrameCount();
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
size_t* identifiersCount,
|
|
|
|
int64* identifiers) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: identifiers; type: simple_vec_byref
|
|
|
|
DCHECK(identifiersCount && (*identifiersCount == 0 || identifiers));
|
|
|
|
if (!identifiersCount || (*identifiersCount > 0 && !identifiers))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Translate param: identifiers; type: simple_vec_byref
|
2017-05-17 11:29:28 +02:00
|
|
|
std::vector<int64> identifiersList;
|
2012-04-03 03:34:16 +02:00
|
|
|
if (identifiersCount && *identifiersCount > 0 && identifiers) {
|
|
|
|
for (size_t i = 0; i < *identifiersCount; ++i) {
|
|
|
|
identifiersList.push_back(identifiers[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefBrowserCppToC::Get(self)->GetFrameIdentifiers(identifiersList);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Restore param: identifiers; type: simple_vec_byref
|
|
|
|
if (identifiersCount && identifiers) {
|
|
|
|
*identifiersCount = std::min(identifiersList.size(), *identifiersCount);
|
|
|
|
if (*identifiersCount > 0) {
|
|
|
|
for (size_t i = 0; i < *identifiersCount; ++i) {
|
|
|
|
identifiers[i] = identifiersList[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_string_list_t names) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: names; type: string_vec_byref
|
|
|
|
DCHECK(names);
|
|
|
|
if (!names)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Translate param: names; type: string_vec_byref
|
|
|
|
std::vector<CefString> namesList;
|
|
|
|
transfer_string_list_contents(names, namesList);
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefBrowserCppToC::Get(self)->GetFrameNames(namesList);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Restore param: names; type: string_vec_byref
|
|
|
|
cef_string_list_clear(names);
|
|
|
|
transfer_string_list_contents(namesList, names);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
browser_send_process_message(struct _cef_browser_t* self,
|
|
|
|
cef_process_id_t target_process,
|
|
|
|
struct _cef_process_message_t* message) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: message; type: refptr_same
|
|
|
|
DCHECK(message);
|
|
|
|
if (!message)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefBrowserCppToC::Get(self)->SendProcessMessage(
|
2017-05-17 11:29:28 +02:00
|
|
|
target_process, CefProcessMessageCppToC::Unwrap(message));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
} // namespace
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
CefBrowserCppToC::CefBrowserCppToC() {
|
|
|
|
GetStruct()->get_host = browser_get_host;
|
|
|
|
GetStruct()->can_go_back = browser_can_go_back;
|
|
|
|
GetStruct()->go_back = browser_go_back;
|
|
|
|
GetStruct()->can_go_forward = browser_can_go_forward;
|
|
|
|
GetStruct()->go_forward = browser_go_forward;
|
|
|
|
GetStruct()->is_loading = browser_is_loading;
|
|
|
|
GetStruct()->reload = browser_reload;
|
|
|
|
GetStruct()->reload_ignore_cache = browser_reload_ignore_cache;
|
|
|
|
GetStruct()->stop_load = browser_stop_load;
|
|
|
|
GetStruct()->get_identifier = browser_get_identifier;
|
|
|
|
GetStruct()->is_same = browser_is_same;
|
|
|
|
GetStruct()->is_popup = browser_is_popup;
|
|
|
|
GetStruct()->has_document = browser_has_document;
|
|
|
|
GetStruct()->get_main_frame = browser_get_main_frame;
|
|
|
|
GetStruct()->get_focused_frame = browser_get_focused_frame;
|
|
|
|
GetStruct()->get_frame_byident = browser_get_frame_byident;
|
|
|
|
GetStruct()->get_frame = browser_get_frame;
|
|
|
|
GetStruct()->get_frame_count = browser_get_frame_count;
|
|
|
|
GetStruct()->get_frame_identifiers = browser_get_frame_identifiers;
|
|
|
|
GetStruct()->get_frame_names = browser_get_frame_names;
|
|
|
|
GetStruct()->send_process_message = browser_send_process_message;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefBrowser>
|
|
|
|
CefCppToCRefCounted<CefBrowserCppToC, CefBrowser, cef_browser_t>::UnwrapDerived(
|
|
|
|
CefWrapperType type,
|
2017-02-09 23:07:43 +01:00
|
|
|
cef_browser_t* s) {
|
2015-04-26 20:40:01 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2016-09-01 13:24:30 +02:00
|
|
|
#if DCHECK_IS_ON()
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
base::AtomicRefCount CefCppToCRefCounted<CefBrowserCppToC,
|
|
|
|
CefBrowser,
|
|
|
|
cef_browser_t>::DebugObjCt = 0;
|
2012-04-03 03:34:16 +02:00
|
|
|
#endif
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefBrowserCppToC,
|
|
|
|
CefBrowser,
|
|
|
|
cef_browser_t>::kWrapperType = WT_BROWSER;
|