public class CefClient extends CefClientHandler implements CefContextMenuHandler, CefDialogHandler, CefDisplayHandler, CefDownloadHandler, CefDragHandler, CefFocusHandler, CefJSDialogHandler, CefKeyboardHandler, CefLifeSpanHandler, CefLoadHandler, CefRenderHandler, CefRequestHandler, CefWindowHandler
CefDialogHandler.FileDialogMode
CefDragHandler.DragOperationMask
CefFocusHandler.FocusSource
CefJSDialogHandler.JSDialogType
CefKeyboardHandler.CefKeyEvent
CefLoadHandler.ErrorCode
CefRequestHandler.TerminationStatus
限定符和类型 | 方法和说明 |
---|---|
CefClient |
addContextMenuHandler(CefContextMenuHandler handler) |
CefClient |
addDialogHandler(CefDialogHandler handler) |
CefClient |
addDisplayHandler(CefDisplayHandler handler) |
CefClient |
addDownloadHandler(CefDownloadHandler handler) |
CefClient |
addDragHandler(CefDragHandler handler) |
CefClient |
addFocusHandler(CefFocusHandler handler) |
CefClient |
addJSDialogHandler(CefJSDialogHandler handler) |
CefClient |
addKeyboardHandler(CefKeyboardHandler handler) |
CefClient |
addLifeSpanHandler(CefLifeSpanHandler handler) |
CefClient |
addLoadHandler(CefLoadHandler handler) |
void |
addMessageRouter(CefMessageRouter messageRouter) |
CefClient |
addRequestHandler(CefRequestHandler handler) |
CefBrowser |
createBrowser(java.lang.String url, boolean isOffscreenRendered, boolean isTransparent) |
CefBrowser |
createBrowser(java.lang.String url, boolean isOffscreenRendered, boolean isTransparent, CefRequestContext context) |
void |
dispose() |
boolean |
doClose(CefBrowser browser)
Called when a browser has received a request to close.
(当浏览器收到关闭请求时调用。)
|
protected java.lang.Object[] |
getAllBrowser()
Returns a list of all browser instances.
(返回所有浏览器实例的列表。)
|
boolean |
getAuthCredentials(CefBrowser browser, CefFrame frame, boolean isProxy, java.lang.String host, int port, java.lang.String realm, java.lang.String scheme, CefAuthCallback callback)
Called on the IO thread when the browser needs credentials from the user.
(当浏览器需要用户的凭据时,在IO线程上调用。)
|
protected CefBrowser |
getBrowser(int identifier)
Returns the java part of the browser implementation.
(返回浏览器实现的java部分。)
|
protected CefContextMenuHandler |
getContextMenuHandler()
Return the handler for context menus.
(返回上下文菜单的处理程序。)
|
protected CefDialogHandler |
getDialogHandler()
Return the handler for dialogs.
(返回对话框的处理程序。)
|
protected CefDisplayHandler |
getDisplayHandler()
Return the handler for browser display state events.
(返回处理程序以获取浏览器显示状态事件。)
|
protected CefDownloadHandler |
getDownloadHandler()
Return the handler for download events.
(返回下载事件的处理程序。)
|
protected CefDragHandler |
getDragHandler()
Return the handler for drag events.
(返回处理程序以进行拖动事件。)
|
protected CefFocusHandler |
getFocusHandler()
Return the handler for focus events.
(返回处理程序以获取焦点事件。)
|
protected CefJSDialogHandler |
getJSDialogHandler()
Return the handler for javascript dialog requests.
(返回javascript对话框请求的处理程序。)
|
protected CefKeyboardHandler |
getKeyboardHandler()
Return the handler for keyboard events.
(返回键盘事件的处理程序。)
|
protected CefLifeSpanHandler |
getLifeSpanHandler()
Return the handler for browser life span events.
(返回处理程序的浏览器寿命事件。)
|
protected CefLoadHandler |
getLoadHandler()
Return the handler for browser load status events.
(返回处理程序以获取浏览器加载状态事件。)
|
java.awt.Rectangle |
getRect(CefBrowser browser)
Retrieve the view rectangle.
(检索视图矩形。)
|
protected CefRenderHandler |
getRenderHandler()
Return the handler for off-screen rendering events.
(返回用于屏幕外渲染事件的处理程序。)
|
protected CefRequestHandler |
getRequestHandler()
Return the handler for browser request events.
(返回处理程序以处理浏览器请求事件。)
|
CefResourceRequestHandler |
getResourceRequestHandler(CefBrowser browser, CefFrame frame, CefRequest request, boolean isNavigation, boolean isDownload, java.lang.String requestInitiator, BoolRef disableDefaultHandling)
Called on the IO thread before a resource request is initiated.
(在启动资源请求之前在IO线程上调用。)
|
java.awt.Point |
getScreenPoint(CefBrowser browser, java.awt.Point viewPoint)
Retrieve the screen point for the specified view point.
(检索指定视点的屏幕点。)
|
java.awt.Rectangle |
getViewRect(CefBrowser browser)
Retrieve the view rectangle.
(检索视图矩形。)
|
protected CefWindowHandler |
getWindowHandler()
Return the handler for windowed rendering events.
(返回窗口渲染事件的处理程序。)
|
void |
onAddressChange(CefBrowser browser, CefFrame frame, java.lang.String url)
Handle address changes.
(处理地址更改。)
|
void |
onAfterCreated(CefBrowser browser)
Handle creation of a new browser window.
(处理新浏览器窗口的创建。)
|
void |
onAfterParentChanged(CefBrowser browser)
Called after a browser's native parent window has changed.
(在浏览器的本机父窗口更改后调用。)
|
boolean |
onBeforeBrowse(CefBrowser browser, CefFrame frame, CefRequest request, boolean user_gesture, boolean is_redirect)
Called on the UI thread before browser navigation.
(浏览器导航之前在UI线程上调用。)
|
void |
onBeforeClose(CefBrowser browser)
Called just before a browser is destroyed.
(在浏览器被销毁之前调用。)
|
void |
onBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams params, CefMenuModel model)
Called before a context menu is displayed.
(在显示上下文菜单之前调用。)
|
void |
onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem, java.lang.String suggestedName, CefBeforeDownloadCallback callback)
Called before a download begins.
(在下载开始之前调用。)
|
boolean |
onBeforePopup(CefBrowser browser, CefFrame frame, java.lang.String target_url, java.lang.String target_frame_name)
Called on the IO thread before a new popup window is created.
(在创建新的弹出窗口之前在IO线程上调用。)
|
boolean |
onBeforeUnloadDialog(CefBrowser browser, java.lang.String message_text, boolean is_reload, CefJSDialogCallback callback)
Called to run a dialog asking the user if they want to leave a page.
(调用此命令可运行一个对话框,询问用户是否要离开页面。)
|
boolean |
onCertificateError(CefBrowser browser, CefLoadHandler.ErrorCode cert_error, java.lang.String request_url, CefRequestCallback callback)
Called on the UI thread to handle requests for URLs with an invalid SSL certificate.
(在UI线程上调用,以处理带有无效SSL证书的URL请求。)
|
boolean |
onConsoleMessage(CefBrowser browser, CefSettings.LogSeverity level, java.lang.String message, java.lang.String source, int line)
Called to display a console message.
(调用以显示控制台消息。)
|
boolean |
onContextMenuCommand(CefBrowser browser, CefFrame frame, CefContextMenuParams params, int commandId, int eventFlags)
Called to execute a command selected from the context menu.
(调用以执行从上下文菜单中选择的命令。)
|
void |
onContextMenuDismissed(CefBrowser browser, CefFrame frame)
Called when the context menu is dismissed irregardless of whether the menu was empty or a command was selected.
(无论上下文菜单为空还是选择了命令,均关闭上下文菜单时调用。)
|
void |
onCursorChange(CefBrowser browser, int cursorType)
Handle cursor changes.
(处理光标更改。)
|
void |
onDialogClosed(CefBrowser browser)
Called when the default implementation dialog is closed.
(关闭默认实现对话框时调用。)
|
void |
onDownloadUpdated(CefBrowser browser, CefDownloadItem downloadItem, CefDownloadItemCallback callback)
Called when a download's status or progress information has been updated.
(当下载状态或进度信息已更新时调用。)
|
boolean |
onDragEnter(CefBrowser browser, CefDragData dragData, int mask)
Called when an external drag event enters the browser window.
(当外部拖动事件进入浏览器窗口时调用。)
|
boolean |
onFileDialog(CefBrowser browser, CefDialogHandler.FileDialogMode mode, java.lang.String title, java.lang.String defaultFilePath, java.util.Vector<java.lang.String> acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback)
Called to run a file chooser dialog.
(调用以运行文件选择器对话框。)
|
void |
onGotFocus(CefBrowser browser)
Called when the browser component has received focus.
(当浏览器组件获得焦点时调用。)
|
boolean |
onJSDialog(CefBrowser browser, java.lang.String origin_url, CefJSDialogHandler.JSDialogType dialog_type, java.lang.String message_text, java.lang.String default_prompt_text, CefJSDialogCallback callback, BoolRef suppress_message)
Called to run a JavaScript dialog.
(调用以运行JavaScript对话框。)
|
boolean |
onKeyEvent(CefBrowser browser, CefKeyboardHandler.CefKeyEvent event)
Called after the renderer and JavaScript in the page has had a chance to handle the event.
(在页面中的渲染器和JavaScript有机会处理该事件之后调用。)
|
void |
onLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode)
Called when the browser is done loading a frame.
(当浏览器完成加载框架时调用。)
|
void |
onLoadError(CefBrowser browser, CefFrame frame, CefLoadHandler.ErrorCode errorCode, java.lang.String errorText, java.lang.String failedUrl)
Called when the resource load for a navigation fails or is canceled.
(当导航的资源加载失败或被取消时调用。)
|
void |
onLoadingStateChange(CefBrowser browser, boolean isLoading, boolean canGoBack, boolean canGoForward)
Called when the loading state has changed.
(加载状态更改时调用。)
|
void |
onLoadStart(CefBrowser browser, CefFrame frame, CefRequest.TransitionType transitionType)
Called when the browser begins loading a frame.
(当浏览器开始加载框架时调用。)
|
void |
onMouseEvent(CefBrowser browser, int event, int screenX, int screenY, int modifier, int button)
Implement this method to handle mouse events on Windows.
(在Windows上实现此方法以处理鼠标事件。)
|
void |
onPaint(CefBrowser browser, boolean popup, java.awt.Rectangle[] dirtyRects, java.nio.ByteBuffer buffer, int width, int height)
Handle painting.
(处理绘画。)
|
void |
onPluginCrashed(CefBrowser browser, java.lang.String pluginPath)
Called on the browser process UI thread when a plugin has crashed.
(插件崩溃时在浏览器进程UI线程上调用。)
|
void |
onPopupShow(CefBrowser browser, boolean show)
Show or hide the popup window.
(显示或隐藏弹出窗口。)
|
void |
onPopupSize(CefBrowser browser, java.awt.Rectangle size)
Size the popup window.
(调整弹出窗口的大小。)
|
boolean |
onPreKeyEvent(CefBrowser browser, CefKeyboardHandler.CefKeyEvent event, BoolRef is_keyboard_shortcut)
Called before a keyboard event is sent to the renderer.
(在键盘事件发送到渲染器之前调用。)
|
boolean |
onQuotaRequest(CefBrowser browser, java.lang.String origin_url, long new_size, CefRequestCallback callback)
Called on the IO thread when JavaScript requests a specific storage quota size via the webkitStorageInfo.requestQuota function.
(当JavaScript通过webkitStorageInfo.requestQuota函数请求特定的存储配额大小时,在IO线程上调用。)
|
void |
onRenderProcessTerminated(CefBrowser browser, CefRequestHandler.TerminationStatus status)
Called on the browser process UI thread when the render process terminates unexpectedly.
(当呈现进程意外终止时,在浏览器进程UI线程上调用。)
|
void |
onResetDialogState(CefBrowser browser)
Called to cancel any pending dialogs and reset any saved dialog state.
(调用以取消所有未决的对话框并重置所有保存的对话框状态。)
|
boolean |
onSetFocus(CefBrowser browser, CefFocusHandler.FocusSource source)
Called when the browser component is requesting focus.
(当浏览器组件正在请求焦点时调用。)
|
void |
onStatusMessage(CefBrowser browser, java.lang.String value)
Called when the browser receives a status message.
(当浏览器收到状态消息时调用。)
|
void |
onTakeFocus(CefBrowser browser, boolean next)
Called when the browser component is about to loose focus.
(当浏览器组件即将失去焦点时调用。)
|
void |
onTitleChange(CefBrowser browser, java.lang.String title)
Handle title changes.
(处理标题更改。)
|
boolean |
onTooltip(CefBrowser browser, java.lang.String text)
Called when the browser is about to display a tooltip.
(当浏览器将要显示工具提示时调用。)
|
void |
removeContextMenuHandler() |
void |
removeDialogHandler() |
void |
removeDisplayHandler() |
void |
removeDownloadHandler() |
void |
removeDragHandler() |
void |
removeFocusHandler() |
void |
removeJSDialogHandler() |
void |
removeKeyboardHandler() |
void |
removeLifeSpanHandler() |
void |
removeLoadHandler() |
void |
removeMessageRouter(CefMessageRouter messageRouter) |
void |
removeRequestHandler() |
boolean |
startDragging(CefBrowser browser, CefDragData dragData, int mask, int x, int y)
Called when the user starts dragging content in the web view.
(当用户开始在Web视图中拖动内容时调用。)
|
void |
updateDragCursor(CefBrowser browser, int operation)
Called when the web view wants to update the mouse cursor during a drag & drop operation.
(在拖放操作期间Web视图要更新鼠标光标时调用。)
|
getNativeRef, removeContextMenuHandler, removeDialogHandler, removeDisplayHandler, removeDownloadHandler, removeDragHandler, removeFocusHandler, removeJSDialogHandler, removeKeyboardHandler, removeLifeSpanHandler, removeLoadHandler, removeRenderHandler, removeRequestHandler, removeWindowHandler, setNativeRef
public CefClient addContextMenuHandler(CefContextMenuHandler handler)
public CefClient addDialogHandler(CefDialogHandler handler)
public CefClient addDisplayHandler(CefDisplayHandler handler)
public CefClient addDownloadHandler(CefDownloadHandler handler)
public CefClient addDragHandler(CefDragHandler handler)
public CefClient addFocusHandler(CefFocusHandler handler)
public CefClient addJSDialogHandler(CefJSDialogHandler handler)
public CefClient addKeyboardHandler(CefKeyboardHandler handler)
public CefClient addLifeSpanHandler(CefLifeSpanHandler handler)
public CefClient addLoadHandler(CefLoadHandler handler)
public void addMessageRouter(CefMessageRouter messageRouter)
addMessageRouter
在类中
CefClientHandler
public CefClient addRequestHandler(CefRequestHandler handler)
public CefBrowser createBrowser(java.lang.String url, boolean isOffscreenRendered, boolean isTransparent)
public CefBrowser createBrowser(java.lang.String url, boolean isOffscreenRendered, boolean isTransparent, CefRequestContext context)
public void dispose()
dispose
在类中
CefClientHandler
public boolean doClose(CefBrowser browser)
CefLifeSpanHandler
doClose
在接口中
CefLifeSpanHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
protected java.lang.Object[] getAllBrowser()
CefClientHandler
getAllBrowser
在类中
CefClientHandler
public boolean getAuthCredentials(CefBrowser browser, CefFrame frame, boolean isProxy, java.lang.String host, int port, java.lang.String realm, java.lang.String scheme, CefAuthCallback callback)
CefRequestHandler
getAuthCredentials
在接口中
CefRequestHandler
browser
- The corresponding browser.
(-相应的浏览器。)
frame
- The frame generating the event. Instance only valid within the scope of this method.
(-生成事件的框架。实例仅在此方法的范围内有效。)
isProxy
- True if the host is a proxy server.
(-如果主机是代理服务器,则为true。)
host
- Hostname.
(- 主机名。)
port
- Port number.
(-端口号。)
realm
- Realm of the request.
(-请求的领域。)
scheme
- Scheme of the request.
(-请求方案。)
callback
- Call CefAuthCallback.Continue() when the authentication information is available.
(-当身份验证信息可用时,调用CefAuthCallback.Continue()。)
protected CefBrowser getBrowser(int identifier)
CefClientHandler
getBrowser
在类中
CefClientHandler
protected CefContextMenuHandler getContextMenuHandler()
CefClientHandler
getContextMenuHandler
在类中
CefClientHandler
protected CefDialogHandler getDialogHandler()
CefClientHandler
getDialogHandler
在类中
CefClientHandler
protected CefDisplayHandler getDisplayHandler()
CefClientHandler
getDisplayHandler
在类中
CefClientHandler
protected CefDownloadHandler getDownloadHandler()
CefClientHandler
getDownloadHandler
在类中
CefClientHandler
protected CefDragHandler getDragHandler()
CefClientHandler
getDragHandler
在类中
CefClientHandler
protected CefFocusHandler getFocusHandler()
CefClientHandler
getFocusHandler
在类中
CefClientHandler
protected CefJSDialogHandler getJSDialogHandler()
CefClientHandler
getJSDialogHandler
在类中
CefClientHandler
protected CefKeyboardHandler getKeyboardHandler()
CefClientHandler
getKeyboardHandler
在类中
CefClientHandler
protected CefLifeSpanHandler getLifeSpanHandler()
CefClientHandler
getLifeSpanHandler
在类中
CefClientHandler
protected CefLoadHandler getLoadHandler()
CefClientHandler
getLoadHandler
在类中
CefClientHandler
public java.awt.Rectangle getRect(CefBrowser browser)
CefWindowHandler
getRect
在接口中
CefWindowHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
protected CefRenderHandler getRenderHandler()
CefClientHandler
getRenderHandler
在类中
CefClientHandler
protected CefRequestHandler getRequestHandler()
CefClientHandler
getRequestHandler
在类中
CefClientHandler
public CefResourceRequestHandler getResourceRequestHandler(CefBrowser browser, CefFrame frame, CefRequest request, boolean isNavigation, boolean isDownload, java.lang.String requestInitiator, BoolRef disableDefaultHandling)
CefRequestHandler
getResourceRequestHandler
在接口中
CefRequestHandler
browser
- The corresponding browser.
(-相应的浏览器。)
frame
- The frame generating the event. Instance only valid within the scope of this method.
(-生成事件的框架。实例仅在此方法的范围内有效。)
request
- The request itself. Cannot be modified in this callback. Instance only valid within the scope of this method.
(-请求本身。无法在此回调中修改。实例仅在此方法的范围内有效。)
isNavigation
- True if the resource request is a navigation.
(-如果资源请求是导航,则为true。)
isDownload
- True if the resource request is a download.
(-如果资源请求是下载,则为true。)
requestInitiator
- The origin (scheme + domain) of the page that initiated the request.
(-发起请求的页面的来源(方案+域)。)
disableDefaultHandling
- Set to true to disable default handling of the request, in which case it will need to be handled via CefResourceRequestHandler.getResourceHandler or it will be canceled.
(-设置为true可禁用请求的默认处理,在这种情况下,需要通过CefResourceRequestHandler.getResourceHandler进行处理,否则将被取消。)
public java.awt.Point getScreenPoint(CefBrowser browser, java.awt.Point viewPoint)
CefRenderHandler
getScreenPoint
在接口中
CefRenderHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
viewPoint
- The point in the view.
(-视图中的点。)
public java.awt.Rectangle getViewRect(CefBrowser browser)
CefRenderHandler
getViewRect
在接口中
CefRenderHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
protected CefWindowHandler getWindowHandler()
CefClientHandler
getWindowHandler
在类中
CefClientHandler
public void onAddressChange(CefBrowser browser, CefFrame frame, java.lang.String url)
CefDisplayHandler
onAddressChange
在接口中
CefDisplayHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
frame
- The frame generating the event.
(-生成事件的框架。)
url
- The new address.
(-新地址。)
public void onAfterCreated(CefBrowser browser)
CefLifeSpanHandler
onAfterCreated
在接口中
CefLifeSpanHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
public void onAfterParentChanged(CefBrowser browser)
CefLifeSpanHandler
onAfterParentChanged
在接口中
CefLifeSpanHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
public boolean onBeforeBrowse(CefBrowser browser, CefFrame frame, CefRequest request, boolean user_gesture, boolean is_redirect)
CefRequestHandler
onBeforeBrowse
在接口中
CefRequestHandler
browser
- The corresponding browser.
(-相应的浏览器。)
frame
- The frame generating the event. Instance only valid within the scope of this method.
(-生成事件的框架。实例仅在此方法的范围内有效。)
request
- The request itself. Cannot be modified in this callback. Instance only valid within the scope of this method.
(-请求本身。无法在此回调中修改。实例仅在此方法的范围内有效。)
user_gesture
- True if the request was initiated by a user gesture.
(-如果请求是由用户手势发起的,则为True。)
is_redirect
- True if the request was redirected.
(-如果请求已重定向,则为true。)
public void onBeforeClose(CefBrowser browser)
CefLifeSpanHandler
onBeforeClose
在接口中
CefLifeSpanHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
public void onBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams params, CefMenuModel model)
CefContextMenuHandler
onBeforeContextMenu
在接口中
CefContextMenuHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
frame
- The frame generating the event. Instance only valid within the scope of this method.
(-生成事件的框架。实例仅在此方法的范围内有效。)
params
- Provides information about the context menu state. Instance only valid within the scope of this method.
(-提供有关上下文菜单状态的信息。实例仅在此方法的范围内有效。)
model
- Can be cleared to show no context menu or modified to show a custom menu. Instance only valid within the scope of this method.
(-可以清除为不显示上下文菜单,也可以修改为显示自定义菜单。实例仅在此方法的范围内有效。)
public void onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem, java.lang.String suggestedName, CefBeforeDownloadCallback callback)
CefDownloadHandler
onBeforeDownload
在接口中
CefDownloadHandler
browser
- The desired browser.
(-所需的浏览器。)
downloadItem
- The item to be downloaded. Do not keep a reference to it outside this method.
(-要下载的项目。不要在此方法之外保留对它的引用。)
suggestedName
- is the suggested name for the download file.
(-是下载文件的建议名称。)
callback
- start the download by calling the Continue method
(-通过调用Continue方法开始下载)
public boolean onBeforePopup(CefBrowser browser, CefFrame frame, java.lang.String target_url, java.lang.String target_frame_name)
CefLifeSpanHandler
onBeforePopup
在接口中
CefLifeSpanHandler
browser
- The source of the popup request.
(-弹出请求的来源。)
frame
- The source of the popup request. Instance only valid within the scope of this method.
(-弹出请求的来源。实例仅在此方法的范围内有效。)
target_url
- May be empty if none is specified with the request.
(-如果请求中未指定任何内容,则可以为空。)
target_frame_name
- May be empty if none is specified with the request.
(-如果请求中未指定任何内容,则可以为空。)
public boolean onBeforeUnloadDialog(CefBrowser browser, java.lang.String message_text, boolean is_reload, CefJSDialogCallback callback)
CefJSDialogHandler
onBeforeUnloadDialog
在接口中
CefJSDialogHandler
browser
- The corresponding browser.
(-相应的浏览器。)
message_text
- The text to be displayed.
(-要显示的文本。)
is_reload
- true if the page is reloaded.
(-如果重新加载页面,则为true。)
callback
- execute callback once the custom dialog is dismissed.
(-一旦关闭自定义对话框,请执行回调。)
public boolean onCertificateError(CefBrowser browser, CefLoadHandler.ErrorCode cert_error, java.lang.String request_url, CefRequestCallback callback)
CefRequestHandler
onCertificateError
在接口中
CefRequestHandler
browser
- The corresponding browser.
(-相应的浏览器。)
cert_error
- Error code describing the error.
(-描述错误的错误代码。)
request_url
- The requesting URL.
(-请求的网址。)
callback
- Call CefRequestCallback.Continue() either in this method or at a later time to continue or cancel the request. If null the error cannot be recovered from and the request will be canceled automatically.
(-在此方法中或在以后的时间调用CefRequestCallback.Continue()以继续或取消请求。如果为null,则无法从中恢复错误,该请求将自动取消。)
public boolean onConsoleMessage(CefBrowser browser, CefSettings.LogSeverity level, java.lang.String message, java.lang.String source, int line)
CefDisplayHandler
onConsoleMessage
在接口中
CefDisplayHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
public boolean onContextMenuCommand(CefBrowser browser, CefFrame frame, CefContextMenuParams params, int commandId, int eventFlags)
CefContextMenuHandler
onContextMenuCommand
在接口中
CefContextMenuHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
frame
- The frame generating the event. Instance only valid within the scope of this method.
(-生成事件的框架。实例仅在此方法的范围内有效。)
params
- Will have the same values that were passed to onBeforeContextMenu(). Instance only valid within the scope of this method.
(-将具有与传递给onBeforeContextMenu()相同的值。实例仅在此方法的范围内有效。)
commandId
- The id of the command.
(-命令的ID。)
eventFlags
- A combination of event flags defined in EventFlags
(-EventFlags中定义的事件标志的组合)
public void onContextMenuDismissed(CefBrowser browser, CefFrame frame)
CefContextMenuHandler
onContextMenuDismissed
在接口中
CefContextMenuHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
frame
- The corresponding frame. Instance only valid within the scope of this method.
(-相应的框架。实例仅在此方法的范围内有效。)
public void onCursorChange(CefBrowser browser, int cursorType)
CefRenderHandler
onCursorChange
在接口中
CefRenderHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
cursorType
- The new cursor.
(-新光标。)
public void onDialogClosed(CefBrowser browser)
CefJSDialogHandler
onDialogClosed
在接口中
CefJSDialogHandler
public void onDownloadUpdated(CefBrowser browser, CefDownloadItem downloadItem, CefDownloadItemCallback callback)
CefDownloadHandler
onDownloadUpdated
在接口中
CefDownloadHandler
browser
- The desired browser.
(-所需的浏览器。)
downloadItem
- The downloading item.
(-下载项目。)
callback
- Execute callback to cancel the download
(-执行回调以取消下载)
public boolean onDragEnter(CefBrowser browser, CefDragData dragData, int mask)
CefDragHandler
onDragEnter
在接口中
CefDragHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
dragData
- Contains the drag event data. Instance only valid within the scope of this method.
(-包含拖动事件数据。实例仅在此方法的范围内有效。)
mask
- Represents the type of drag operation. See DragOperationMask for possible values.
(-表示拖动操作的类型。有关可能的值,请参见DragOperationMask。)
public boolean onFileDialog(CefBrowser browser, CefDialogHandler.FileDialogMode mode, java.lang.String title, java.lang.String defaultFilePath, java.util.Vector<java.lang.String> acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback)
CefDialogHandler
onFileDialog
在接口中
CefDialogHandler
mode
- represents the type of dialog to display.
title
- to be used for the dialog and may be empty to show the default title ("Open" or "Save" depending on the mode).
defaultFilePath
- is the path with optional directory and/or file name component that should be initially selected in the dialog.
acceptFilters
- are used to restrict the selectable file types and may any combination of (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c) combined description and file extension delimited using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg").
selectedAcceptFilter
- is the 0-based index of the filter that should be selected by default.
callback
- is a callback handler for handling own file dialogs.
public void onGotFocus(CefBrowser browser)
CefFocusHandler
onGotFocus
在接口中
CefFocusHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
public boolean onJSDialog(CefBrowser browser, java.lang.String origin_url, CefJSDialogHandler.JSDialogType dialog_type, java.lang.String message_text, java.lang.String default_prompt_text, CefJSDialogCallback callback, BoolRef suppress_message)
CefJSDialogHandler
onJSDialog
在接口中
CefJSDialogHandler
browser
- The corresponding browser.
(-相应的浏览器。)
origin_url
- The originating url.
(-原始网址。)
dialog_type
- the dialog type.
(-对话框类型。)
message_text
- the text to be displayed.
(-要显示的文本。)
default_prompt_text
- value will be specified for prompt dialogs only.
(-将仅为提示对话框指定值。)
callback
- execute callback once the custom dialog is dismissed.
(-一旦关闭自定义对话框,请执行回调。)
suppress_message
- set to true to suppress displaying the message.
(-设置为true以禁止显示消息。)
public boolean onKeyEvent(CefBrowser browser, CefKeyboardHandler.CefKeyEvent event)
CefKeyboardHandler
onKeyEvent
在接口中
CefKeyboardHandler
browser
- the corresponding browser.
(-相应的浏览器。)
event
- contains information about the keyboard event.
(-包含有关键盘事件的信息。)
public void onLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode)
CefLoadHandler
onLoadEnd
在接口中
CefLoadHandler
browser
- The corresponding browser.
(-相应的浏览器。)
frame
- The frame generating the event. Instance only valid within the scope of this method.
(-生成事件的框架。实例仅在此方法的范围内有效。)
httpStatusCode
- The status code of the load.
(-负载的状态码。)
public void onLoadError(CefBrowser browser, CefFrame frame, CefLoadHandler.ErrorCode errorCode, java.lang.String errorText, java.lang.String failedUrl)
CefLoadHandler
onLoadError
在接口中
CefLoadHandler
browser
- The corresponding browser.
(-相应的浏览器。)
frame
- The frame generating the event. Instance only valid within the scope of this method.
(-生成事件的框架。实例仅在此方法的范围内有效。)
errorCode
- The error code number.
(-错误代码编号。)
errorText
- The error text.
(-错误文本。)
failedUrl
- The URL that failed to load.
(-无法加载的网址。)
public void onLoadingStateChange(CefBrowser browser, boolean isLoading, boolean canGoBack, boolean canGoForward)
CefLoadHandler
onLoadingStateChange
在接口中
CefLoadHandler
browser
- The corresponding browser.
(-相应的浏览器。)
isLoading
- true if it is loading.
(-如果正在加载,则为true。)
canGoBack
- true if you can navigate back.
(-如果可以返回导航,则为true。)
canGoForward
- true if you can navigate forward.
(-如果可以向前导航,则为true。)
public void onLoadStart(CefBrowser browser, CefFrame frame, CefRequest.TransitionType transitionType)
CefLoadHandler
onLoadStart
在接口中
CefLoadHandler
browser
- The corresponding browser.
(-相应的浏览器。)
frame
- The frame generating the event. Instance only valid within the scope of this method.
(-生成事件的框架。实例仅在此方法的范围内有效。)
transitionType
- The transition type.
(-过渡类型。)
public void onMouseEvent(CefBrowser browser, int event, int screenX, int screenY, int modifier, int button)
CefWindowHandler
onMouseEvent
在接口中
CefWindowHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
event
- A mouse event like MouseEvent.MOUSE_MOVED.
(-鼠标事件,例如MouseEvent.MOUSE_MOVED。)
screenX
- The absolute X position on the screen.
(-屏幕上的绝对X位置。)
screenY
- The absolute Y position on the screen.
(-屏幕上的绝对Y位置。)
modifier
- The modifier keys down during event (e.g. Shift, Ctrl).
(-在事件发生期间,修饰键会向下键(例如Shift,Ctrl)。)
button
- An integer indicating which mouse button state changed. If parameter event is set to MouseEvent.MOUSE_WHEEL, the value of this parameter specifies the rotation indicator (negative value for left scroll and positive value for right scroll).
(-一个整数,指示更改的鼠标按钮状态。如果参数event设置为MouseEvent.MOUSE_WHEEL,则此参数的值指定旋转指示器(左滚动为负值,右滚动为正值)。)
public void onPaint(CefBrowser browser, boolean popup, java.awt.Rectangle[] dirtyRects, java.nio.ByteBuffer buffer, int width, int height)
CefRenderHandler
onPaint
在接口中
CefRenderHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
popup
- True if painting a popup window.
(-如果绘制一个弹出窗口,则为true。)
dirtyRects
- Array of dirty regions.
(-脏区阵列。)
buffer
- Pixel buffer for the whole window.
(-整个窗口的像素缓冲区。)
width
- Width of the buffer.
(-缓冲区的宽度。)
height
- Height of the buffer.
(-缓冲区的高度。)
public void onPluginCrashed(CefBrowser browser, java.lang.String pluginPath)
CefRequestHandler
onPluginCrashed
在接口中
CefRequestHandler
browser
- The corresponding browser.
(-相应的浏览器。)
pluginPath
- The path of the plugin that crashed.
(-崩溃的插件的路径。)
public void onPopupShow(CefBrowser browser, boolean show)
CefRenderHandler
onPopupShow
在接口中
CefRenderHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
show
- True if the popup window is being shown.
(-如果显示弹出窗口,则为True。)
public void onPopupSize(CefBrowser browser, java.awt.Rectangle size)
CefRenderHandler
onPopupSize
在接口中
CefRenderHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
size
- Size of the popup window.
(-弹出窗口的大小。)
public boolean onPreKeyEvent(CefBrowser browser, CefKeyboardHandler.CefKeyEvent event, BoolRef is_keyboard_shortcut)
CefKeyboardHandler
onPreKeyEvent
在接口中
CefKeyboardHandler
browser
- the corresponding browser.
(-相应的浏览器。)
event
- contains information about the keyboard event.
(-包含有关键盘事件的信息。)
is_keyboard_shortcut
- set to true and return false, if the event will be handled in OnKeyEvent() as a keyboard shortcut.
(-如果事件将作为键盘快捷键在OnKeyEvent()中处理,则设置为true并返回false。)
public boolean onQuotaRequest(CefBrowser browser, java.lang.String origin_url, long new_size, CefRequestCallback callback)
CefRequestHandler
onQuotaRequest
在接口中
CefRequestHandler
browser
- The corresponding browser.
(-相应的浏览器。)
origin_url
- Origin of the page making the request.
(-发出请求的页面的来源。)
new_size
- Requested quota size in bytes.
(-请求的配额大小(以字节为单位)。)
callback
- Call CefRequestCallback.Continue() either in this method or at a later time to grant or deny the request.
(-使用此方法或以后的方法调用CefRequestCallback.Continue()以授予或拒绝该请求。)
public void onRenderProcessTerminated(CefBrowser browser, CefRequestHandler.TerminationStatus status)
CefRequestHandler
onRenderProcessTerminated
在接口中
CefRequestHandler
browser
- The corresponding browser.
(-相应的浏览器。)
status
- Indicates how the process was terminated.
(-指示进程如何终止。)
public void onResetDialogState(CefBrowser browser)
CefJSDialogHandler
onResetDialogState
在接口中
CefJSDialogHandler
public boolean onSetFocus(CefBrowser browser, CefFocusHandler.FocusSource source)
CefFocusHandler
onSetFocus
在接口中
CefFocusHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
source
- indicates/ where the focus request is originating from.
(-指示/焦点请求来自何处。)
public void onStatusMessage(CefBrowser browser, java.lang.String value)
CefDisplayHandler
onStatusMessage
在接口中
CefDisplayHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
value
- Contains the text that will be displayed in the status message.
(-包含将在状态消息中显示的文本。)
public void onTakeFocus(CefBrowser browser, boolean next)
CefFocusHandler
onTakeFocus
在接口中
CefFocusHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
next
- will be true if the browser is giving focus to the next component and false if the browser is giving focus to the previous component.
(-如果浏览器将焦点放在下一个组件上,则为true;如果浏览器将焦点放在上一个组件上,则为false。)
public void onTitleChange(CefBrowser browser, java.lang.String title)
CefDisplayHandler
onTitleChange
在接口中
CefDisplayHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
title
- The new title.
(-新标题。)
public boolean onTooltip(CefBrowser browser, java.lang.String text)
CefDisplayHandler
onTooltip
在接口中
CefDisplayHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
text
- Contains the text that will be displayed in the tooltip.
(-包含将在工具提示中显示的文本。)
public void removeContextMenuHandler()
public void removeDialogHandler()
public void removeDisplayHandler()
public void removeDownloadHandler()
public void removeDragHandler()
public void removeFocusHandler()
public void removeJSDialogHandler()
public void removeKeyboardHandler()
public void removeLifeSpanHandler()
public void removeLoadHandler()
public void removeMessageRouter(CefMessageRouter messageRouter)
removeMessageRouter
在类中
CefClientHandler
public void removeRequestHandler()
public boolean startDragging(CefBrowser browser, CefDragData dragData, int mask, int x, int y)
CefRenderHandler
startDragging
在接口中
CefRenderHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
dragData
- Contextual information about the dragged content
(-有关所拖动内容的上下文信息)
mask
- Describes the allowed operation (none, move, copy, link).
(-描述允许的操作(无,移动,复制,链接)。)
x
- Coordinate within CefBrowser
(-在CefBrowser中协调)
y
- Coordinate within CefBrowser
(-在CefBrowser中协调)
public void updateDragCursor(CefBrowser browser, int operation)
CefRenderHandler
updateDragCursor
在接口中
CefRenderHandler
browser
- The browser generating the event.
(-浏览器生成事件。)
operation
- Describes the allowed operation (none, move, copy, link).
(-描述允许的操作(无,移动,复制,链接)。)