UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CEFWebBrowserDialog.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
#include "
CoreMinimal.h
"
6
#include "
Misc/AssertionMacros.h
"
7
#include "
Internationalization/Text.h
"
8
9
#if WITH_CEF3
10
11
#include "
HAL/PlatformAtomics.h
"
12
13
#if PLATFORM_WINDOWS
14
# include "
Windows/AllowWindowsPlatformTypes.h
"
15
# include "
Windows/AllowWindowsPlatformAtomics.h
"
16
#endif
17
#pragma push_macro("OVERRIDE")
18
# undef OVERRIDE
// cef headers provide their own OVERRIDE macro
19
#if PLATFORM_APPLE
20
PRAGMA_DISABLE_DEPRECATION_WARNINGS
21
#endif
22
# include "include/cef_jsdialog_handler.h"
23
#if PLATFORM_APPLE
24
PRAGMA_ENABLE_DEPRECATION_WARNINGS
25
#endif
26
#pragma pop_macro("OVERRIDE")
27
#if PLATFORM_WINDOWS
28
# include "
Windows/HideWindowsPlatformAtomics.h
"
29
# include "
Windows/HideWindowsPlatformTypes.h
"
30
#endif
31
32
#include "
IWebBrowserDialog.h
"
33
34
class
FCEFWebBrowserDialog
35
:
public
IWebBrowserDialog
36
{
37
public
:
38
virtual
~FCEFWebBrowserDialog
()
39
{}
40
41
// IWebBrowserDialog interface:
42
43
virtual
EWebBrowserDialogType
GetType
()
override
44
{
45
return
Type
;
46
}
47
48
virtual
const
FText
&
GetMessageText
()
override
49
{
50
return
MessageText;
51
}
52
53
virtual
const
FText
&
GetDefaultPrompt
()
override
54
{
55
return
DefaultPrompt
;
56
}
57
58
virtual
bool
IsReload
()
override
59
{
60
check
(Type ==
EWebBrowserDialogType::Unload
);
61
return
bIsReload
;
62
}
63
64
virtual
void
Continue
(
bool
Success
=
true
,
const
FText
&
UserResponse
=
FText::GetEmpty
())
override
65
{
66
check
(Type ==
EWebBrowserDialogType::Prompt
||
UserResponse
.IsEmpty());
67
Callback->Continue(
Success
,
TCHAR_TO_WCHAR
(*
UserResponse
.ToString()));
68
}
69
70
private
:
71
72
73
EWebBrowserDialogType
Type
;
74
FText
MessageText;
75
FText
DefaultPrompt
;
76
bool
bIsReload
;
77
78
CefRefPtr<CefJSDialogCallback>
Callback;
79
80
// Create a dialog from OnJSDialog arguments
81
FCEFWebBrowserDialog
(CefJSDialogHandler::JSDialogType
InDialogType
,
const
CefString
&
InMessageText
,
const
CefString
&
InDefaultPrompt
,
CefRefPtr<CefJSDialogCallback>
InCallback
)
82
:
Type
((
EWebBrowserDialogType
)
InDialogType
)
83
, MessageText(
FText
::
FromString
(
WCHAR_TO_TCHAR
(
InMessageText
.
ToWString
().
c_str
())))
84
,
DefaultPrompt
(
FText
::
FromString
(
WCHAR_TO_TCHAR
(
InDefaultPrompt
.
ToWString
().
c_str
())))
85
,
bIsReload
(
false
)
86
, Callback(
InCallback
)
87
{}
88
89
// Create a dialog from OnBeforeUnloadDialog arguments
90
FCEFWebBrowserDialog
(
const
CefString
&
InMessageText
,
bool
InIsReload
,
CefRefPtr<CefJSDialogCallback>
InCallback
)
91
:
Type
(
EWebBrowserDialogType
::
Unload
)
92
, MessageText(
FText
::
FromString
(
WCHAR_TO_TCHAR
(
InMessageText
.
ToWString
().
c_str
())))
93
,
DefaultPrompt
(
FText
::GetEmpty())
94
,
bIsReload
(
InIsReload
)
95
, Callback(
InCallback
)
96
{};
97
98
friend
class
FCEFWebBrowserWindow
;
99
};
100
101
typedef
FCEFWebBrowserDialog
FWebBrowserDialog
;
102
103
#endif
AllowWindowsPlatformAtomics.h
AllowWindowsPlatformTypes.h
AssertionMacros.h
check
#define check(expr)
Definition
AssertionMacros.h:314
ESwapAudioOutputDeviceResultState::Success
@ Success
CoreMinimal.h
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition
GenericPlatformCompilerPreSetup.h:12
PRAGMA_DISABLE_DEPRECATION_WARNINGS
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition
GenericPlatformCompilerPreSetup.h:8
HideWindowsPlatformAtomics.h
HideWindowsPlatformTypes.h
IWebBrowserDialog.h
EWebBrowserDialogType
EWebBrowserDialogType
Definition
IWebBrowserDialog.h:12
EWebBrowserDialogType::Prompt
@ Prompt
EWebBrowserDialogType::Unload
@ Unload
EWebBrowserDialogEventResponse::Continue
@ Continue
PlatformAtomics.h
WCHAR_TO_TCHAR
#define WCHAR_TO_TCHAR(str)
Definition
StringConv.h:1093
TCHAR_TO_WCHAR
#define TCHAR_TO_WCHAR(str)
Definition
StringConv.h:1092
Text.h
ELocatorResolveFlags::Unload
@ Unload
FText
Definition
Text.h:385
FText::GetEmpty
static CORE_API const FText & GetEmpty()
Definition
Text.cpp:252
IWebBrowserDialog
Definition
IWebBrowserDialog.h:42
IWebBrowserDialog::GetType
virtual EWebBrowserDialogType GetType()=0
IWebBrowserDialog::IsReload
virtual bool IsReload()=0
IWebBrowserDialog::GetMessageText
virtual const FText & GetMessageText()=0
IWebBrowserDialog::GetDefaultPrompt
virtual const FText & GetDefaultPrompt()=0
EBuildConfigurations::FromString
EBuildConfiguration FromString(const FString &Configuration)
Definition
GenericPlatformMisc.cpp:330
EPawnActionMoveMode::Type
Type
Definition
PawnAction_Move.h:11
false
@ false
Definition
radaudio_common.h:23
Engine
Source
Runtime
WebBrowser
Private
CEF
CEFWebBrowserDialog.h
Generated by
1.9.8