2020-01-06 10:59:05 +01:00
|
|
|
// Copyright (c) 2020 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.
|
|
|
|
//
|
2020-01-15 14:53:19 +01:00
|
|
|
// $hash=243cd9194d5b67b3ba35ae8b3f7c58588c0ccebb$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-05-19 11:06:00 +02:00
|
|
|
#include "libcef_dll/ctocpp/life_span_handler_ctocpp.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
2019-03-19 10:42:54 +01:00
|
|
|
#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
|
2013-02-08 01:07:41 +01:00
|
|
|
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/ctocpp/client_ctocpp.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-05-17 11:29:28 +02:00
|
|
|
bool CefLifeSpanHandlerCToCpp::OnBeforePopup(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefString& target_url,
|
2015-03-06 22:38:38 +01:00
|
|
|
const CefString& target_frame_name,
|
2017-05-17 11:29:28 +02:00
|
|
|
WindowOpenDisposition target_disposition,
|
|
|
|
bool user_gesture,
|
|
|
|
const CefPopupFeatures& popupFeatures,
|
|
|
|
CefWindowInfo& windowInfo,
|
|
|
|
CefRefPtr<CefClient>& client,
|
|
|
|
CefBrowserSettings& settings,
|
2019-03-19 10:42:54 +01:00
|
|
|
CefRefPtr<CefDictionaryValue>& extra_info,
|
2015-03-06 22:38:38 +01:00
|
|
|
bool* no_javascript_access) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_life_span_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_before_popup))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2013-02-08 01:07:41 +01:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
|
|
|
if (!frame.get())
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
2013-02-08 01:07:41 +01:00
|
|
|
// Verify param: no_javascript_access; type: bool_byaddr
|
|
|
|
DCHECK(no_javascript_access);
|
|
|
|
if (!no_javascript_access)
|
|
|
|
return false;
|
|
|
|
// Unverified params: target_url, target_frame_name
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Translate param: client; type: refptr_same_byref
|
|
|
|
cef_client_t* clientStruct = NULL;
|
|
|
|
if (client.get())
|
|
|
|
clientStruct = CefClientCToCpp::Unwrap(client);
|
|
|
|
cef_client_t* clientOrig = clientStruct;
|
2019-03-19 10:42:54 +01:00
|
|
|
// Translate param: extra_info; type: refptr_diff_byref
|
|
|
|
cef_dictionary_value_t* extra_infoStruct = NULL;
|
|
|
|
if (extra_info.get())
|
|
|
|
extra_infoStruct = CefDictionaryValueCppToC::Wrap(extra_info);
|
|
|
|
cef_dictionary_value_t* extra_infoOrig = extra_infoStruct;
|
2013-02-09 23:38:24 +01:00
|
|
|
// Translate param: no_javascript_access; type: bool_byaddr
|
2017-05-17 11:29:28 +02:00
|
|
|
int no_javascript_accessInt =
|
|
|
|
no_javascript_access ? *no_javascript_access : 0;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
int _retval = _struct->on_before_popup(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
target_url.GetStruct(), target_frame_name.GetStruct(), target_disposition,
|
|
|
|
user_gesture, &popupFeatures, &windowInfo, &clientStruct, &settings,
|
2019-03-19 10:42:54 +01:00
|
|
|
&extra_infoStruct, &no_javascript_accessInt);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Restore param:client; type: refptr_same_byref
|
|
|
|
if (clientStruct) {
|
|
|
|
if (clientStruct != clientOrig) {
|
|
|
|
client = CefClientCToCpp::Wrap(clientStruct);
|
|
|
|
}
|
|
|
|
} else {
|
2020-01-15 14:53:19 +01:00
|
|
|
client = nullptr;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
2019-03-19 10:42:54 +01:00
|
|
|
// Restore param:extra_info; type: refptr_diff_byref
|
|
|
|
if (extra_infoStruct) {
|
|
|
|
if (extra_infoStruct != extra_infoOrig) {
|
|
|
|
extra_info = CefDictionaryValueCppToC::Unwrap(extra_infoStruct);
|
|
|
|
}
|
|
|
|
} else {
|
2020-01-15 14:53:19 +01:00
|
|
|
extra_info = nullptr;
|
2019-03-19 10:42:54 +01:00
|
|
|
}
|
2013-02-09 23:38:24 +01:00
|
|
|
// Restore param:no_javascript_access; type: bool_byaddr
|
|
|
|
if (no_javascript_access)
|
2017-05-17 11:29:28 +02:00
|
|
|
*no_javascript_access = no_javascript_accessInt ? true : false;
|
2013-02-09 23:38:24 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2012-04-03 03:34:16 +02:00
|
|
|
void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_life_span_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_after_created))
|
2012-04-03 03:34:16 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
_struct->on_after_created(_struct, CefBrowserCppToC::Wrap(browser));
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2012-04-03 03:34:16 +02:00
|
|
|
bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr<CefBrowser> browser) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_life_span_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, do_close))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
int _retval = _struct->do_close(_struct, CefBrowserCppToC::Wrap(browser));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2012-04-03 03:34:16 +02:00
|
|
|
void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_life_span_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_before_close))
|
2012-04-03 03:34:16 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
_struct->on_before_close(_struct, CefBrowserCppToC::Wrap(browser));
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CefLifeSpanHandlerCToCpp::CefLifeSpanHandlerCToCpp() {}
|
2015-04-26 20:40:01 +02:00
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefLifeSpanHandlerCToCpp::~CefLifeSpanHandlerCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
cef_life_span_handler_t* CefCToCppRefCounted<
|
|
|
|
CefLifeSpanHandlerCToCpp,
|
|
|
|
CefLifeSpanHandler,
|
|
|
|
cef_life_span_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefLifeSpanHandler* c) {
|
2015-04-26 20:40:01 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2015-04-26 20:40:01 +02:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefLifeSpanHandlerCToCpp,
|
|
|
|
CefLifeSpanHandler,
|
|
|
|
cef_life_span_handler_t>::kWrapperType =
|
2015-04-26 20:40:01 +02:00
|
|
|
WT_LIFE_SPAN_HANDLER;
|