2023-01-02 23:47:15 +01:00
|
|
|
// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
|
2022-06-30 09:31:18 +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.
|
|
|
|
//
|
2023-05-08 17:15:02 +02:00
|
|
|
// $hash=866524abe3d8f0ad9953a6364bbb49f625fe3a38$
|
2022-06-30 09:31:18 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/ctocpp/permission_handler_ctocpp.h"
|
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/media_access_callback_cpptoc.h"
|
2022-07-07 12:01:24 +02:00
|
|
|
#include "libcef_dll/cpptoc/permission_prompt_callback_cpptoc.h"
|
2022-06-30 09:31:18 +02:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
bool CefPermissionHandlerCToCpp::OnRequestMediaAccessPermission(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
2022-07-07 12:01:24 +02:00
|
|
|
const CefString& requesting_origin,
|
2022-06-30 09:31:18 +02:00
|
|
|
uint32 requested_permissions,
|
|
|
|
CefRefPtr<CefMediaAccessCallback> callback) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_permission_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_request_media_access_permission)) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-06-30 09:31:18 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-06-30 09:31:18 +02:00
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!frame.get()) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
// Verify param: requesting_origin; type: string_byref_const
|
|
|
|
DCHECK(!requesting_origin.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (requesting_origin.empty()) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-06-30 09:31:18 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback.get()) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-06-30 09:31:18 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->on_request_media_access_permission(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
2022-07-07 12:01:24 +02:00
|
|
|
requesting_origin.GetStruct(), requested_permissions,
|
2022-06-30 09:31:18 +02:00
|
|
|
CefMediaAccessCallbackCppToC::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
2022-07-07 12:01:24 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
bool CefPermissionHandlerCToCpp::OnShowPermissionPrompt(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
uint64 prompt_id,
|
|
|
|
const CefString& requesting_origin,
|
|
|
|
uint32 requested_permissions,
|
|
|
|
CefRefPtr<CefPermissionPromptCallback> callback) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_permission_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_show_permission_prompt)) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
// Verify param: requesting_origin; type: string_byref_const
|
|
|
|
DCHECK(!requesting_origin.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (requesting_origin.empty()) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback.get()) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->on_show_permission_prompt(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), prompt_id,
|
|
|
|
requesting_origin.GetStruct(), requested_permissions,
|
|
|
|
CefPermissionPromptCallbackCppToC::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefPermissionHandlerCToCpp::OnDismissPermissionPrompt(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
uint64 prompt_id,
|
|
|
|
cef_permission_request_result_t result) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_permission_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_dismiss_permission_prompt)) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_dismiss_permission_prompt(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), prompt_id, result);
|
|
|
|
}
|
|
|
|
|
2022-06-30 09:31:18 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefPermissionHandlerCToCpp::CefPermissionHandlerCToCpp() {}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefPermissionHandlerCToCpp::~CefPermissionHandlerCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
cef_permission_handler_t* CefCToCppRefCounted<
|
|
|
|
CefPermissionHandlerCToCpp,
|
|
|
|
CefPermissionHandler,
|
|
|
|
cef_permission_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefPermissionHandler* c) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2022-06-30 09:31:18 +02:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefPermissionHandlerCToCpp,
|
|
|
|
CefPermissionHandler,
|
|
|
|
cef_permission_handler_t>::kWrapperType =
|
|
|
|
WT_PERMISSION_HANDLER;
|