forked from chromiumembedded/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCefMessageRouterHandler.java
More file actions
40 lines (36 loc) · 1.66 KB
/
CefMessageRouterHandler.java
File metadata and controls
40 lines (36 loc) · 1.66 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
// 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;
/**
* 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 query.
* @param browser The browser generating the event.
* @param frame The frame generating the event.
* @param query_id The unique ID for the query.
* @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 query_id, String request,
boolean persistent, CefQueryCallback callback);
/**
* Called when a pending JavaScript query is canceled.
* @param browser The browser generating the event.
* @param frame The frame generating the event.
* @param query_id The unique ID for the query.
*/
public void onQueryCanceled(CefBrowser browser, CefFrame frame, long query_id);
}