-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathCefClientHandler.cpp
175 lines (156 loc) · 5.59 KB
/
CefClientHandler.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "CefClientHandler.h"
#include "client_handler.h"
#include "jni_util.h"
#include "message_router_handler.h"
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1CefClientHandler_1CTOR(
JNIEnv* env,
jobject clientHandler) {
CefRefPtr<ClientHandler> client = new ClientHandler(env, clientHandler);
SetCefForJNIObject(env, clientHandler, client.get(), "CefClientHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1addMessageRouter(
JNIEnv* env,
jobject clientHandler,
jobject jmessageRouter) {
CefRefPtr<ClientHandler> client = GetCefFromJNIObject<ClientHandler>(
env, clientHandler, "CefClientHandler");
if (!client.get())
return;
client->AddMessageRouter(env, jmessageRouter);
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeContextMenuHandler(
JNIEnv* env,
jobject clientHandler,
jobject contextMenuHandler) {
SetCefForJNIObject<CefContextMenuHandler>(env, contextMenuHandler, nullptr,
"CefContextMenuHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeDialogHandler(
JNIEnv* env,
jobject clientHandler,
jobject dialogHandler) {
SetCefForJNIObject<CefDialogHandler>(env, dialogHandler, nullptr,
"CefDialogHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeDisplayHandler(
JNIEnv* env,
jobject clientHandler,
jobject displayHandler) {
SetCefForJNIObject<CefDisplayHandler>(env, displayHandler, nullptr,
"CefDisplayHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeDownloadHandler(
JNIEnv* env,
jobject clientHandler,
jobject downloadHandler) {
SetCefForJNIObject<CefDownloadHandler>(env, downloadHandler, nullptr,
"CefDownloadHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeDragHandler(
JNIEnv* env,
jobject clientHandler,
jobject dragHandler) {
SetCefForJNIObject<CefDragHandler>(env, dragHandler, nullptr,
"CefDragHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeFocusHandler(
JNIEnv* env,
jobject clientHandler,
jobject focusHandler) {
SetCefForJNIObject<CefFocusHandler>(env, focusHandler, nullptr,
"CefFocusHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeJSDialogHandler(
JNIEnv* env,
jobject clientHandler,
jobject jsdialogHandler) {
SetCefForJNIObject<CefJSDialogHandler>(env, jsdialogHandler, nullptr,
"CefJSDialogHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeKeyboardHandler(
JNIEnv* env,
jobject clientHandler,
jobject keyboardHandler) {
SetCefForJNIObject<CefKeyboardHandler>(env, keyboardHandler, nullptr,
"CefKeyboardHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeLifeSpanHandler(
JNIEnv* env,
jobject clientHandler,
jobject lifeSpanHandler) {
SetCefForJNIObject<CefLifeSpanHandler>(env, lifeSpanHandler, nullptr,
"CefLifeSpanHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeLoadHandler(
JNIEnv* env,
jobject clientHandler,
jobject loadHandler) {
SetCefForJNIObject<CefLoadHandler>(env, loadHandler, nullptr,
"CefLoadHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removePrintHandler(
JNIEnv* env,
jobject clientHandler,
jobject printHandler) {
SetCefForJNIObject<CefPrintHandler>(env, printHandler, nullptr,
"CefPrintHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeMessageRouter(
JNIEnv* env,
jobject clientHandler,
jobject jmessageRouter) {
CefRefPtr<ClientHandler> client = GetCefFromJNIObject<ClientHandler>(
env, clientHandler, "CefClientHandler");
if (!client.get())
return;
client->RemoveMessageRouter(env, jmessageRouter);
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeRenderHandler(
JNIEnv* env,
jobject clientHandler,
jobject renderHandler) {
SetCefForJNIObject<CefRenderHandler>(env, renderHandler, nullptr,
"CefRenderHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeRequestHandler(
JNIEnv* env,
jobject clientHandler,
jobject requestHandler) {
SetCefForJNIObject<CefRequestHandler>(env, requestHandler, nullptr,
"CefRequestHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1removeWindowHandler(
JNIEnv* env,
jobject clientHandler,
jobject windowHandler) {
SetCefForJNIObject<WindowHandler>(env, windowHandler, nullptr,
"CefWindowHandler");
}
JNIEXPORT void JNICALL
Java_org_cef_handler_CefClientHandler_N_1CefClientHandler_1DTOR(
JNIEnv* env,
jobject clientHandler) {
// delete reference to the native client handler
SetCefForJNIObject<ClientHandler>(env, clientHandler, nullptr,
"CefClientHandler");
}