-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathCefMessageRouterHandler.java
More file actions
64 lines (58 loc) · 2.86 KB
/
CefMessageRouterHandler.java
File metadata and controls
64 lines (58 loc) · 2.86 KB
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
// 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.
package org.cef.handler;
import org.cef.browser.CefBrowser;
import org.cef.browser.CefFrame;
import org.cef.callback.CefNative;
import org.cef.callback.CefQueryCallback;
import java.nio.ByteBuffer;
/**
* Implement this interface to handle queries. All methods will be executed on the browser process
* UI thread.
*/
public interface CefMessageRouterHandler extends CefNative {
/**
* Called when the browser receives a JavaScript text query.
*
* @param browser The corresponding browser.
* @param frame The frame generating the event. Instance only valid within the scope of this
* method.
* @param queryId The unique ID for the query.
* @param request The query text.
* @param persistent True if the query is persistent.
* @param callback Object used to continue or cancel the query asynchronously.
* @return True to handle the query or false to propagate the query to other registered
* handlers, if any. If no handlers return true from this method then the query will be
* automatically canceled with an error code of -1 delivered to the JavaScript onFailure
* callback.
*/
public boolean onQuery(CefBrowser browser, CefFrame frame, long queryId, String request,
boolean persistent, CefQueryCallback callback);
/**
* Called when the browser receives a JavaScript binary query.
*
* @param browser The corresponding browser.
* @param frame The frame generating the event. Instance only valid within the scope of this
* method.
* @param queryId The unique ID for the query.
* @param request The query direct buffer. Valid only for the scope of this method.
* @param persistent True if the query is persistent.
* @param callback Object used to continue or cancel the query asynchronously.
* @return True to handle the query or false to propagate the query to other registered
* handlers, if any. If no handlers return true from this method then the query will be
* automatically canceled with an error code of -1 delivered to the JavaScript onFailure
* callback.
*/
public boolean onQuery(CefBrowser browser, CefFrame frame, long queryId, ByteBuffer request,
boolean persistent, CefQueryCallback callback);
/**
* Called when a pending JavaScript query is canceled.
*
* @param browser The corresponding browser.
* @param frame The frame generating the event. Instance only valid within the scope of this
* method.
* @param queryId The unique ID for the query.
*/
public void onQueryCanceled(CefBrowser browser, CefFrame frame, long queryId);
}