2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 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.
|
|
|
|
//
|
2024-01-05 19:03:36 +01:00
|
|
|
// $hash=398d0c16437a05d58807df64539cf202774d28c2$
|
2022-06-30 09:31:18 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/permission_handler_cpptoc.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
|
2022-06-30 09:31:18 +02:00
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/media_access_callback_ctocpp.h"
|
2022-07-07 12:01:24 +02:00
|
|
|
#include "libcef_dll/ctocpp/permission_prompt_callback_ctocpp.h"
|
2022-06-30 09:31:18 +02:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
int CEF_CALLBACK permission_handler_on_request_media_access_permission(
|
|
|
|
struct _cef_permission_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
2022-07-07 12:01:24 +02:00
|
|
|
const cef_string_t* requesting_origin,
|
2023-06-01 16:07:20 +02:00
|
|
|
uint32_t requested_permissions,
|
2022-06-30 09:31:18 +02:00
|
|
|
cef_media_access_callback_t* callback) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-06-30 09:31:18 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-06-30 09:31:18 +02:00
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!frame) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return 0;
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!requesting_origin) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-06-30 09:31:18 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback) {
|
2022-06-30 09:31:18 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-06-30 09:31:18 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval =
|
|
|
|
CefPermissionHandlerCppToC::Get(self)->OnRequestMediaAccessPermission(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
2022-07-07 12:01:24 +02:00
|
|
|
CefString(requesting_origin), requested_permissions,
|
2022-06-30 09:31:18 +02:00
|
|
|
CefMediaAccessCallbackCToCpp::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2022-07-07 12:01:24 +02:00
|
|
|
int CEF_CALLBACK permission_handler_on_show_permission_prompt(
|
|
|
|
struct _cef_permission_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
2023-06-01 16:07:20 +02:00
|
|
|
uint64_t prompt_id,
|
2022-07-07 12:01:24 +02:00
|
|
|
const cef_string_t* requesting_origin,
|
2023-06-01 16:07:20 +02:00
|
|
|
uint32_t requested_permissions,
|
2022-07-07 12:01:24 +02:00
|
|
|
cef_permission_prompt_callback_t* callback) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return 0;
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!requesting_origin) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback) {
|
2022-07-07 12:01:24 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-07 12:01:24 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefPermissionHandlerCppToC::Get(self)->OnShowPermissionPrompt(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), prompt_id, CefString(requesting_origin),
|
|
|
|
requested_permissions, CefPermissionPromptCallbackCToCpp::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK permission_handler_on_dismiss_permission_prompt(
|
|
|
|
struct _cef_permission_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
2023-06-01 16:07:20 +02:00
|
|
|
uint64_t prompt_id,
|
2022-07-07 12:01:24 +02:00
|
|
|
cef_permission_request_result_t result) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
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
|
|
|
|
CefPermissionHandlerCppToC::Get(self)->OnDismissPermissionPrompt(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), prompt_id, result);
|
|
|
|
}
|
|
|
|
|
2022-06-30 09:31:18 +02:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefPermissionHandlerCppToC::CefPermissionHandlerCppToC() {
|
|
|
|
GetStruct()->on_request_media_access_permission =
|
|
|
|
permission_handler_on_request_media_access_permission;
|
2022-07-07 12:01:24 +02:00
|
|
|
GetStruct()->on_show_permission_prompt =
|
|
|
|
permission_handler_on_show_permission_prompt;
|
|
|
|
GetStruct()->on_dismiss_permission_prompt =
|
|
|
|
permission_handler_on_dismiss_permission_prompt;
|
2022-06-30 09:31:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefPermissionHandlerCppToC::~CefPermissionHandlerCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefRefPtr<CefPermissionHandler> CefCppToCRefCounted<
|
|
|
|
CefPermissionHandlerCppToC,
|
|
|
|
CefPermissionHandler,
|
|
|
|
cef_permission_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_permission_handler_t* s) {
|
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 CefCppToCRefCounted<CefPermissionHandlerCppToC,
|
|
|
|
CefPermissionHandler,
|
|
|
|
cef_permission_handler_t>::kWrapperType =
|
|
|
|
WT_PERMISSION_HANDLER;
|