public class CefClient extends CefClientHandler implements CefContextMenuHandler, CefDialogHandler, CefDisplayHandler, CefDownloadHandler, CefDragHandler, CefFocusHandler, CefJSDialogHandler, CefKeyboardHandler, CefLifeSpanHandler, CefLoadHandler, CefRenderHandler, CefRequestHandler, CefWindowHandler
CefContextMenuHandler.EventFlags
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.(返回浏览器请求事件的处理程序)
|
CefResourceHandler |
getResourceHandler(CefBrowser browser,
CefFrame frame,
CefRequest request)
Called on the IO thread before a resource is loaded.(在加载资源之前调用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.(处理新浏览器窗口的创建)
|
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 |
onBeforeResourceLoad(CefBrowser browser,
CefFrame frame,
CefRequest request)
Called on the IO thread before a resource request is loaded.(在加载资源请求之前调用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.(在将键盘事件发送到渲染器之前调用)
|
void |
onProtocolExecution(CefBrowser browser,
java.lang.String url,
BoolRef allow_os_execution)
Called on the UI thread to handle requests for URLs with an unknown
protocol component.(在UI线程上调用以处理具有未知协议组件的URL的请求)
|
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.(调用取消任何挂起的对话框并重置任何已保存的对话框状态)
|
void |
onResourceLoadComplete(CefBrowser browser,
CefFrame frame,
CefRequest request,
CefResponse response,
CefURLRequest.Status status,
long receivedContentLength)
Called on the IO thread when a resource load has completed.(资源加载完成时在IO线程上调用)
|
void |
onResourceRedirect(CefBrowser browser,
CefFrame frame,
CefRequest request,
CefResponse response,
StringRef new_url)
Called on the IO thread when a resource load is redirected.(重定向资源加载时在IO线程上调用)
|
boolean |
onResourceResponse(CefBrowser browser,
CefFrame frame,
CefRequest request,
CefResponse response)
Called on the IO thread when a resource response is received.(收到资源响应时,在IO线程上调用)
|
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
- indicates whether the host is a proxy server.host
- contains the hostname.port
- contains the port number.realm
- The realm of the request.scheme
- The scheme of the request.callback
- call CefAuthCallback::Continue() when the authentication
information is available.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 CefResourceHandler getResourceHandler(CefBrowser browser, CefFrame frame, CefRequest request)
CefRequestHandler
getResourceHandler
在接口中 CefRequestHandler
browser
- The corresponding browser.frame
- The frame generating the event. Instance only valid within
the scope of this method.request
- The request itself. Should not be modified in this callback.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 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. Can't be modified.user_gesture
- true if the request was initiated by a user gesture.is_redirect
- true if the request was redirected.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 corresponding browser.frame
- The corresponding frame.params
- provides information about the context menu state.model
- can be cleared to show no context menu or modified
to show a custom menu.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 methodpublic 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.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 onBeforeResourceLoad(CefBrowser browser, CefFrame frame, CefRequest request)
CefRequestHandler
onBeforeResourceLoad
在接口中 CefRequestHandler
browser
- The corresponding browser.frame
- The frame generating the event. Instance only valid within
the scope of this method.request
- The request object may be modified.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.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() to continue
or cancel the request.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 corresponding browser.frame
- The corresponding frame.params
- Will have the same values as what was passed to onBeforeContextMenu().commandId
- The id of the command.eventFlags
- A combination of event flags defined in EventFlagspublic void onContextMenuDismissed(CefBrowser browser, CefFrame frame)
CefContextMenuHandler
onContextMenuDismissed
在接口中 CefContextMenuHandler
browser
- The corresponding browser.frame
- The corresponding frame.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 downloadpublic boolean onDragEnter(CefBrowser browser, CefDragData dragData, int mask)
CefDragHandler
onDragEnter
在接口中 CefDragHandler
browser
- The corresponding browser.dragData
- contains the drag event datamask
- represents the type of drag operation. See DragOperationMask for possible values.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.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 affected browser.frame
- The loading frame.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 affected browser.frame
- The loading frame.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 affected browser.isLoading
- true if it is loading.canGoBack
- true if you can navigate back.canGoForward
- true if you can navigate forward.public void onLoadStart(CefBrowser browser, CefFrame frame, CefRequest.TransitionType transitionType)
CefLoadHandler
onLoadStart
在接口中 CefLoadHandler
browser
- The affected browser.frame
- The loading frame.transitionType
- The transition typepublic 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.screenX
- The absolute X position on the screen.screenY
- The absolute Y position on the screen.modifier
- The modifier keys down during event (e.g. 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).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.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.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.public void onProtocolExecution(CefBrowser browser, java.lang.String url, BoolRef allow_os_execution)
CefRequestHandler
onProtocolExecution
在接口中 CefRequestHandler
public boolean onQuotaRequest(CefBrowser browser, java.lang.String origin_url, long new_size, CefRequestCallback callback)
CefRequestHandler
onQuotaRequest
在接口中 CefRequestHandler
browser
- The corresponding browser.origin_url
- is the origin of the page making the request.new_size
- is the requested quota size in bytes.callback
- call CefRequestCallback::Continue() either in this method or
at a later time to grant or deny the request.public void onRenderProcessTerminated(CefBrowser browser, CefRequestHandler.TerminationStatus status)
CefRequestHandler
onRenderProcessTerminated
在接口中 CefRequestHandler
public void onResetDialogState(CefBrowser browser)
CefJSDialogHandler
onResetDialogState
在接口中 CefJSDialogHandler
public void onResourceLoadComplete(CefBrowser browser, CefFrame frame, CefRequest request, CefResponse response, CefURLRequest.Status status, long receivedContentLength)
CefRequestHandler
onResourceLoadComplete
在接口中 CefRequestHandler
browser
- The corresponding browser.frame
- The frame generating the event. Instance only valid within
the scope of this method.request
- The request itself. Should not be modified in this callback.response
- The response that resulted in the redirect. Should not be
modified in this callback.status
- The load completion statusreceivedContentLength
- The number of bytes readpublic void onResourceRedirect(CefBrowser browser, CefFrame frame, CefRequest request, CefResponse response, StringRef new_url)
CefRequestHandler
onResourceRedirect
在接口中 CefRequestHandler
browser
- The corresponding browser.frame
- The frame generating the event. Instance only valid within
the scope of this method.request
- The request itself. Should not be modified in this callback.response
- The response that resulted in the redirect. Should not be
modified in this callback.new_url
- Contains the new URL and can be changed if desired.public boolean onResourceResponse(CefBrowser browser, CefFrame frame, CefRequest request, CefResponse response)
CefRequestHandler
onResourceResponse
在接口中 CefRequestHandler
browser
- The corresponding browser.frame
- The frame generating the event. Instance only valid within
the scope of this method.request
- The request itself. To redirect or retry the resource
modify |request| (url, headers or post body) and return trueresponse
- The response that resulted in the redirect. Should not be
modified in this callback.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.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 contentmask
- Describes the allowed operation (none, move, copy, link).x
- Coordinate within CefBrowsery
- Coordinate within CefBrowserpublic void updateDragCursor(CefBrowser browser, int operation)
CefRenderHandler
updateDragCursor
在接口中 CefRenderHandler
browser
- The browser generating the event.operation
- Describes the allowed operation (none, move, copy, link).