Package org.cef

Class CefClient

    • Method Detail

      • createBrowser

        public CefBrowser createBrowser​(java.lang.String url,
                                        boolean isOffscreenRendered,
                                        boolean isTransparent)
      • createBrowser

        public CefBrowser createBrowser​(java.lang.String url,
                                        boolean isOffscreenRendered,
                                        boolean isTransparent,
                                        CefRequestContext context)
      • getBrowser

        protected CefBrowser getBrowser​(int identifier)
        Description copied from class: CefClientHandler
        Returns the java part of the browser implementation.
        Specified by:
        getBrowser in class CefClientHandler
        Returns:
        The found browser or null if none is found.
      • getAllBrowser

        protected java.lang.Object[] getAllBrowser()
        Description copied from class: CefClientHandler
        Returns a list of all browser instances.
        Specified by:
        getAllBrowser in class CefClientHandler
        Returns:
        an array of browser Instances.
      • getPrintHandler

        protected CefPrintHandler getPrintHandler()
        Description copied from class: CefClientHandler
        Return the handler for printing on Linux. If a print handler is not provided then printing will not be supported on the Linux platform. This method is a callback method and is called by the native code.
        Specified by:
        getPrintHandler in class CefClientHandler
      • removeContextMenuHandler

        public void removeContextMenuHandler()
      • onBeforeContextMenu

        public void onBeforeContextMenu​(CefBrowser browser,
                                        CefFrame frame,
                                        CefContextMenuParams params,
                                        CefMenuModel model)
        Description copied from interface: CefContextMenuHandler
        Called before a context menu is displayed.
        Specified by:
        onBeforeContextMenu in interface CefContextMenuHandler
        Parameters:
        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.
      • onContextMenuCommand

        public boolean onContextMenuCommand​(CefBrowser browser,
                                            CefFrame frame,
                                            CefContextMenuParams params,
                                            int commandId,
                                            int eventFlags)
        Description copied from interface: CefContextMenuHandler
        Called to execute a command selected from the context menu. Return true if the command was handled or false for the default implementation. See cef_menu_id_t for the command ids that have default implementations. All user-defined command ids should be between MENU_ID_USER_FIRST and
        Specified by:
        onContextMenuCommand in interface CefContextMenuHandler
        Parameters:
        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.
        commandId - The id of the command.
        eventFlags - A combination of event flags defined in EventFlags
        Returns:
        true if the command was handled or false for the default implementation.
      • onContextMenuDismissed

        public void onContextMenuDismissed​(CefBrowser browser,
                                           CefFrame frame)
        Description copied from interface: CefContextMenuHandler
        Called when the context menu is dismissed irregardless of whether the menu was empty or a command was selected.
        Specified by:
        onContextMenuDismissed in interface CefContextMenuHandler
        Parameters:
        browser - The browser generating the event.
        frame - The corresponding frame. Instance only valid within the scope of this method.
      • removeDialogHandler

        public void removeDialogHandler()
      • onFileDialog

        public boolean onFileDialog​(CefBrowser browser,
                                    CefDialogHandler.FileDialogMode mode,
                                    java.lang.String title,
                                    java.lang.String defaultFilePath,
                                    java.util.Vector<java.lang.String> acceptFilters,
                                    CefFileDialogCallback callback)
        Description copied from interface: CefDialogHandler
        Called to run a file chooser dialog.
        Specified by:
        onFileDialog in interface 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").
        callback - is a callback handler for handling own file dialogs.
        Returns:
        To display a custom dialog return true and execute callback. To display the default dialog return false.
      • removeDisplayHandler

        public void removeDisplayHandler()
      • onAddressChange

        public void onAddressChange​(CefBrowser browser,
                                    CefFrame frame,
                                    java.lang.String url)
        Description copied from interface: CefDisplayHandler
        Browser address changed.
        Specified by:
        onAddressChange in interface CefDisplayHandler
        Parameters:
        browser - The browser generating the event.
        frame - The frame generating the event.
        url - The new address.
      • onTitleChange

        public void onTitleChange​(CefBrowser browser,
                                  java.lang.String title)
        Description copied from interface: CefDisplayHandler
        Browser title changed.
        Specified by:
        onTitleChange in interface CefDisplayHandler
        Parameters:
        browser - The browser generating the event.
        title - The new title.
      • OnFullscreenModeChange

        public void OnFullscreenModeChange​(CefBrowser browser,
                                           boolean fullscreen)
        Description copied from interface: CefDisplayHandler
        Browser fullscreen mode changed.
        Specified by:
        OnFullscreenModeChange in interface CefDisplayHandler
        Parameters:
        browser - The browser generating the event.
        fullscreen - True if fullscreen mode is on.
      • onTooltip

        public boolean onTooltip​(CefBrowser browser,
                                 java.lang.String text)
        Description copied from interface: CefDisplayHandler
        About to display a tooltip.
        Specified by:
        onTooltip in interface CefDisplayHandler
        Parameters:
        browser - The browser generating the event.
        text - Contains the text that will be displayed in the tooltip.
        Returns:
        true to handle the tooltip display yourself.
      • onStatusMessage

        public void onStatusMessage​(CefBrowser browser,
                                    java.lang.String value)
        Description copied from interface: CefDisplayHandler
        Received a status message.
        Specified by:
        onStatusMessage in interface CefDisplayHandler
        Parameters:
        browser - The browser generating the event.
        value - Contains the text that will be displayed in the status message.
      • onConsoleMessage

        public boolean onConsoleMessage​(CefBrowser browser,
                                        CefSettings.LogSeverity level,
                                        java.lang.String message,
                                        java.lang.String source,
                                        int line)
        Description copied from interface: CefDisplayHandler
        Display a console message.
        Specified by:
        onConsoleMessage in interface CefDisplayHandler
        Parameters:
        browser - The browser generating the event.
        Returns:
        true to stop the message from being output to the console.
      • removeDownloadHandler

        public void removeDownloadHandler()
      • onBeforeDownload

        public void onBeforeDownload​(CefBrowser browser,
                                     CefDownloadItem downloadItem,
                                     java.lang.String suggestedName,
                                     CefBeforeDownloadCallback callback)
        Description copied from interface: CefDownloadHandler
        Called before a download begins. By default the download will be canceled. Execute callback either asynchronously or in this method to continue the download if desired.
        Specified by:
        onBeforeDownload in interface CefDownloadHandler
        Parameters:
        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
      • removeDragHandler

        public void removeDragHandler()
      • onDragEnter

        public boolean onDragEnter​(CefBrowser browser,
                                   CefDragData dragData,
                                   int mask)
        Description copied from interface: CefDragHandler
        Called when an external drag event enters the browser window.
        Specified by:
        onDragEnter in interface CefDragHandler
        Parameters:
        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.
        Returns:
        False for default drag handling behavior or true to cancel the drag event.
      • removeFocusHandler

        public void removeFocusHandler()
      • onTakeFocus

        public void onTakeFocus​(CefBrowser browser,
                                boolean next)
        Description copied from interface: CefFocusHandler
        Called when the browser component is about to loose focus. For instance, if focus was on the last HTML element and the user pressed the TAB key.
        Specified by:
        onTakeFocus in interface CefFocusHandler
        Parameters:
        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.
      • onSetFocus

        public boolean onSetFocus​(CefBrowser browser,
                                  CefFocusHandler.FocusSource source)
        Description copied from interface: CefFocusHandler
        Called when the browser component is requesting focus.
        Specified by:
        onSetFocus in interface CefFocusHandler
        Parameters:
        browser - The browser generating the event.
        source - indicates/ where the focus request is originating from.
        Returns:
        false to allow the focus to be set or true to cancel setting the focus.
      • onGotFocus

        public void onGotFocus​(CefBrowser browser)
        Description copied from interface: CefFocusHandler
        Called when the browser component has received focus.
        Specified by:
        onGotFocus in interface CefFocusHandler
        Parameters:
        browser - The browser generating the event.
      • removeJSDialogHandler

        public void removeJSDialogHandler()
      • onJSDialog

        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)
        Description copied from interface: CefJSDialogHandler
        Called to run a JavaScript dialog. Set suppress_message to true and return false to suppress the message (suppressing messages is preferable to immediately executing the callback as this is used to detect presumably malicious behavior like spamming alert messages in onbeforeunload). Set suppress_message to false and return false to use the default implementation (the default implementation will show one modal dialog at a time and suppress any additional dialog requests until the displayed dialog is dismissed). Return true if the application will use a custom dialog or if the callback has been executed immediately. Custom dialogs may be either modal or modeless. If a custom dialog is used the application must execute callback once the custom dialog is dismissed.
        Specified by:
        onJSDialog in interface CefJSDialogHandler
        Parameters:
        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.
        Returns:
        false to use the default dialog implementation. Return true if the application will use a custom dialog.
      • onBeforeUnloadDialog

        public boolean onBeforeUnloadDialog​(CefBrowser browser,
                                            java.lang.String message_text,
                                            boolean is_reload,
                                            CefJSDialogCallback callback)
        Description copied from interface: CefJSDialogHandler
        Called to run a dialog asking the user if they want to leave a page. Return false to use the default dialog implementation. Return true if the application will use a custom dialog or if the callback has been executed immediately. Custom dialogs may be either modal or modeless. If a custom dialog is used the application must execute callback once the custom dialog is dismissed.
        Specified by:
        onBeforeUnloadDialog in interface CefJSDialogHandler
        Parameters:
        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.
        Returns:
        false to use the default dialog implementation. Return true if the application will use a custom dialog.
      • onResetDialogState

        public void onResetDialogState​(CefBrowser browser)
        Description copied from interface: CefJSDialogHandler
        Called to cancel any pending dialogs and reset any saved dialog state. Will be called due to events like page navigation irregardless of whether any dialogs are currently pending.
        Specified by:
        onResetDialogState in interface CefJSDialogHandler
      • removeKeyboardHandler

        public void removeKeyboardHandler()
      • onPreKeyEvent

        public boolean onPreKeyEvent​(CefBrowser browser,
                                     CefKeyboardHandler.CefKeyEvent event,
                                     BoolRef is_keyboard_shortcut)
        Description copied from interface: CefKeyboardHandler
        Called before a keyboard event is sent to the renderer.
        Specified by:
        onPreKeyEvent in interface CefKeyboardHandler
        Parameters:
        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.
        Returns:
        true if the event was handled or false otherwise.
      • onKeyEvent

        public boolean onKeyEvent​(CefBrowser browser,
                                  CefKeyboardHandler.CefKeyEvent event)
        Description copied from interface: CefKeyboardHandler
        Called after the renderer and JavaScript in the page has had a chance to handle the event.
        Specified by:
        onKeyEvent in interface CefKeyboardHandler
        Parameters:
        browser - the corresponding browser.
        event - contains information about the keyboard event.
        Returns:
        true if the keyboard event was handled or false otherwise.
      • removeLifeSpanHandler

        public void removeLifeSpanHandler()
      • onBeforePopup

        public boolean onBeforePopup​(CefBrowser browser,
                                     CefFrame frame,
                                     java.lang.String target_url,
                                     java.lang.String target_frame_name)
        Description copied from interface: CefLifeSpanHandler
        Called on the IO thread before a new popup window is created.
        Specified by:
        onBeforePopup in interface CefLifeSpanHandler
        Parameters:
        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.
        Returns:
        True to cancel creation of the popup window or false to proceed.
      • doClose

        public boolean doClose​(CefBrowser browser)
        Description copied from interface: CefLifeSpanHandler
        Called when a browser has received a request to close. If CEF created an OS window for the browser returning false will send an OS close notification to the browser window's top-level owner (e.g. WM_CLOSE on Windows, performClose: on OS-X and "delete_event" on Linux). If no OS window exists (window rendering disabled) returning false will cause the browser object to be destroyed immediately. Return true if the browser is parented to another window and that other window needs to receive close notification via some non-standard technique.
        Specified by:
        doClose in interface CefLifeSpanHandler
        Parameters:
        browser - The browser generating the event.
        Returns:
        False to send an OS close notification to the browser window's top-level owner.
      • onBeforeClose

        public void onBeforeClose​(CefBrowser browser)
        Description copied from interface: CefLifeSpanHandler
        Called just before a browser is destroyed. Release all references to the browser object and do not attempt to execute any methods on the browser object after this callback returns. If this is a modal window and a custom modal loop implementation was provided in runModal() this callback should be used to exit the custom modal loop. See doClose() documentation for additional usage information.
        Specified by:
        onBeforeClose in interface CefLifeSpanHandler
        Parameters:
        browser - The browser generating the event.
      • removeLoadHandler

        public void removeLoadHandler()
      • onLoadingStateChange

        public void onLoadingStateChange​(CefBrowser browser,
                                         boolean isLoading,
                                         boolean canGoBack,
                                         boolean canGoForward)
        Description copied from interface: CefLoadHandler
        Called when the loading state has changed. This callback will be executed twice -- once when loading is initiated either programmatically or by user action, and once when loading is terminated due to completion, cancellation of failure.
        Specified by:
        onLoadingStateChange in interface CefLoadHandler
        Parameters:
        browser - The corresponding browser.
        isLoading - true if it is loading.
        canGoBack - true if you can navigate back.
        canGoForward - true if you can navigate forward.
      • onLoadStart

        public void onLoadStart​(CefBrowser browser,
                                CefFrame frame,
                                CefRequest.TransitionType transitionType)
        Description copied from interface: CefLoadHandler
        Called when the browser begins loading a frame. The frameIdentifer value will never be empty. Multiple frames may be loading at the same time. Sub-frames may start or continue loading after the main frame load has ended. This method may not be called for a particular frame if the load request for that frame fails. For notification of overall browser load status use onLoadingStateChange instead.
        Specified by:
        onLoadStart in interface CefLoadHandler
        Parameters:
        browser - The corresponding browser.
        frame - The frame generating the event. Instance only valid within the scope of this method.
        transitionType - The transition type.
      • onLoadEnd

        public void onLoadEnd​(CefBrowser browser,
                              CefFrame frame,
                              int httpStatusCode)
        Description copied from interface: CefLoadHandler
        Called when the browser is done loading a frame. The frameIdentifer value will never be empty. Multiple frames may be loading at the same time. Sub-frames may start or continue loading after the main frame load has ended. This method will always be called for all frames irrespective of whether the request completes successfully.
        Specified by:
        onLoadEnd in interface CefLoadHandler
        Parameters:
        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.
      • onLoadError

        public void onLoadError​(CefBrowser browser,
                                CefFrame frame,
                                CefLoadHandler.ErrorCode errorCode,
                                java.lang.String errorText,
                                java.lang.String failedUrl)
        Description copied from interface: CefLoadHandler
        Called when the resource load for a navigation fails or is canceled.
        Specified by:
        onLoadError in interface CefLoadHandler
        Parameters:
        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.
      • removePrintHandler

        public void removePrintHandler()
      • onPrintStart

        public void onPrintStart​(CefBrowser browser)
        Description copied from interface: CefPrintHandler
        Called when printing has started. This method will be called before the other onPrint*() methods and irrespective of how printing was initiated (e.g. CefBrowser::print(), JavaScript window.print() or PDF extension print button).
        Specified by:
        onPrintStart in interface CefPrintHandler
        Parameters:
        browser - The corresponding browser.
      • onPrintSettings

        public void onPrintSettings​(CefBrowser browser,
                                    CefPrintSettings settings,
                                    boolean getDefaults)
        Description copied from interface: CefPrintHandler
        Called to get print settings.
        Specified by:
        onPrintSettings in interface CefPrintHandler
        Parameters:
        browser - The corresponding browser.
        settings - Populate with the desired print settings. Do not keep a reference to this object outside of this callback.
        getDefaults - If true |settings| should be populated with the default print settings.
      • onPrintDialog

        public boolean onPrintDialog​(CefBrowser browser,
                                     boolean hasSelection,
                                     CefPrintDialogCallback callback)
        Description copied from interface: CefPrintHandler
        Called to show the print dialog.
        Specified by:
        onPrintDialog in interface CefPrintHandler
        Parameters:
        browser - The corresponding browser.
        hasSelection - True if the user has selected a region of the page to print.
        callback - Callback to execute after the dialog is dismissed.
        Returns:
        True if the dialog will be displayed or false to cancel the printing immediately.
      • onPrintJob

        public boolean onPrintJob​(CefBrowser browser,
                                  java.lang.String documentName,
                                  java.lang.String pdfFilePath,
                                  CefPrintJobCallback callback)
        Description copied from interface: CefPrintHandler
        Called to send the print job to the printer.
        Specified by:
        onPrintJob in interface CefPrintHandler
        Parameters:
        browser - The corresponding browser.
        documentName - Name of the document that is printing.
        pdfFilePath - Path to the PDF file that contains the document contents.
        callback - Callback to execute after the print job has completed.
        Returns:
        True if the job will proceed or false to cancel the printing immediately.
      • onPrintReset

        public void onPrintReset​(CefBrowser browser)
        Description copied from interface: CefPrintHandler
        Called to reset client state related to printing.
        Specified by:
        onPrintReset in interface CefPrintHandler
        Parameters:
        browser - The corresponding browser.
      • getPdfPaperSize

        public java.awt.Dimension getPdfPaperSize​(CefBrowser browser,
                                                  int deviceUnitsPerInch)
        Description copied from interface: CefPrintHandler
        Called to retrieve the page size when printToPDF is requested for a browser.
        Specified by:
        getPdfPaperSize in interface CefPrintHandler
        Parameters:
        browser - The corresponding browser.
        deviceUnitsPerInch - The DPI of the print. Use this to calculate the page size to use.
        Returns:
        The page size in microns.
      • getViewRect

        public java.awt.Rectangle getViewRect​(CefBrowser browser)
        Description copied from interface: CefRenderHandler
        Retrieve the view rectangle.
        Specified by:
        getViewRect in interface CefRenderHandler
        Parameters:
        browser - The browser generating the event.
        Returns:
        The view rectangle.
      • getScreenPoint

        public java.awt.Point getScreenPoint​(CefBrowser browser,
                                             java.awt.Point viewPoint)
        Description copied from interface: CefRenderHandler
        Retrieve the screen point for the specified view point.
        Specified by:
        getScreenPoint in interface CefRenderHandler
        Parameters:
        browser - The browser generating the event.
        viewPoint - The point in the view.
        Returns:
        The screen point.
      • onPopupShow

        public void onPopupShow​(CefBrowser browser,
                                boolean show)
        Description copied from interface: CefRenderHandler
        Show or hide the popup window.
        Specified by:
        onPopupShow in interface CefRenderHandler
        Parameters:
        browser - The browser generating the event.
        show - True if the popup window is being shown.
      • onPopupSize

        public void onPopupSize​(CefBrowser browser,
                                java.awt.Rectangle size)
        Description copied from interface: CefRenderHandler
        Size the popup window.
        Specified by:
        onPopupSize in interface CefRenderHandler
        Parameters:
        browser - The browser generating the event.
        size - Size of the popup window.
      • onPaint

        public void onPaint​(CefBrowser browser,
                            boolean popup,
                            java.awt.Rectangle[] dirtyRects,
                            java.nio.ByteBuffer buffer,
                            int width,
                            int height)
        Description copied from interface: CefRenderHandler
        Handle painting.
        Specified by:
        onPaint in interface CefRenderHandler
        Parameters:
        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.
      • addOnPaintListener

        public void addOnPaintListener​(java.util.function.Consumer<CefPaintEvent> listener)
        Description copied from interface: CefRenderHandler
        Add provided listener.
        Specified by:
        addOnPaintListener in interface CefRenderHandler
        Parameters:
        listener - Code that gets executed after a frame was rendered.
      • setOnPaintListener

        public void setOnPaintListener​(java.util.function.Consumer<CefPaintEvent> listener)
        Description copied from interface: CefRenderHandler
        Remove existing listeners and replace with provided listener.
        Specified by:
        setOnPaintListener in interface CefRenderHandler
        Parameters:
        listener - Code that gets executed after a frame was rendered.
      • removeOnPaintListener

        public void removeOnPaintListener​(java.util.function.Consumer<CefPaintEvent> listener)
        Description copied from interface: CefRenderHandler
        Remove provided listener.
        Specified by:
        removeOnPaintListener in interface CefRenderHandler
        Parameters:
        listener - Code that gets executed after a frame was rendered.
      • startDragging

        public boolean startDragging​(CefBrowser browser,
                                     CefDragData dragData,
                                     int mask,
                                     int x,
                                     int y)
        Description copied from interface: CefRenderHandler
        Called when the user starts dragging content in the web view. Contextual information about the dragged content is supplied by dragData. OS APIs that run a system message loop may be used within the StartDragging call. Return false to abort the drag operation. Don't call any of CefBrowser-dragSource*Ended* methods after returning false. Return true to handle the drag operation. Call CefBrowser.dragSourceEndedAt and CefBrowser.ragSourceSystemDragEnded either synchronously or asynchronously to inform the web view that the drag operation has ended.
        Specified by:
        startDragging in interface CefRenderHandler
        Parameters:
        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
        y - Coordinate within CefBrowser
        Returns:
        false to abort the drag operation or true to handle the drag operation.
      • updateDragCursor

        public void updateDragCursor​(CefBrowser browser,
                                     int operation)
        Description copied from interface: CefRenderHandler
        Called when the web view wants to update the mouse cursor during a drag & drop operation.
        Specified by:
        updateDragCursor in interface CefRenderHandler
        Parameters:
        browser - The browser generating the event.
        operation - Describes the allowed operation (none, move, copy, link).
      • removeRequestHandler

        public void removeRequestHandler()
      • onBeforeBrowse

        public boolean onBeforeBrowse​(CefBrowser browser,
                                      CefFrame frame,
                                      CefRequest request,
                                      boolean user_gesture,
                                      boolean is_redirect)
        Description copied from interface: CefRequestHandler
        Called on the UI thread before browser navigation. CefLoadHandler.onLoadingStateChange() will be called twice in all cases. If the navigation is allowed CefLoadHandler.onLoadStart() and CefLoadHandler.onLoadEnd() will be called. If the navigation is canceled CefLoadHandler.onLoadError() will be called with an errorCode value of ERR_ABORTED.
        Specified by:
        onBeforeBrowse in interface CefRequestHandler
        Parameters:
        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.
        is_redirect - True if the request was redirected.
        Returns:
        True to cancel the navigation or false to continue.
      • onOpenURLFromTab

        public boolean onOpenURLFromTab​(CefBrowser browser,
                                        CefFrame frame,
                                        java.lang.String target_url,
                                        boolean user_gesture)
        Description copied from interface: CefRequestHandler
        Called on the UI thread before OnBeforeBrowse in certain limited cases where navigating a new or different browser might be desirable. This includes user-initiated navigation that might open in a special way (e.g. links clicked via middle-click or ctrl + left-click) and certain types of cross-origin navigation initiated from the renderer process (e.g. navigating the top-level frame to/from a file URL).
        Specified by:
        onOpenURLFromTab in interface CefRequestHandler
        Parameters:
        browser - The corresponding browser.
        frame - The frame generating the event. Instance only valid within the scope of this method
        user_gesture - True if the request was initiated by a user gesture.
        Returns:
        True to cancel navigation or false to continue
      • getResourceRequestHandler

        public CefResourceRequestHandler getResourceRequestHandler​(CefBrowser browser,
                                                                   CefFrame frame,
                                                                   CefRequest request,
                                                                   boolean isNavigation,
                                                                   boolean isDownload,
                                                                   java.lang.String requestInitiator,
                                                                   BoolRef disableDefaultHandling)
        Description copied from interface: CefRequestHandler
        Called on the IO thread before a resource request is initiated. The |browser| and |frame| values represent the source of the request. If this callback returns null the same method will be called on the associated CefRequestContextHandler, if any.
        Specified by:
        getResourceRequestHandler in interface CefRequestHandler
        Parameters:
        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.
        isDownload - True if the resource request is a download.
        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.
        Returns:
        A CefResourceRequestHandler instance or null.
      • getAuthCredentials

        public boolean getAuthCredentials​(CefBrowser browser,
                                          java.lang.String origin_url,
                                          boolean isProxy,
                                          java.lang.String host,
                                          int port,
                                          java.lang.String realm,
                                          java.lang.String scheme,
                                          CefAuthCallback callback)
        Description copied from interface: CefRequestHandler
        Called on the IO thread when the browser needs credentials from the user.
        Specified by:
        getAuthCredentials in interface CefRequestHandler
        Parameters:
        browser - The corresponding browser.
        origin_url - The origin making this authentication request.
        isProxy - True if the host is a proxy server.
        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.
        Returns:
        True to continue the request (callback must be executed) or false to cancel.
      • onCertificateError

        public boolean onCertificateError​(CefBrowser browser,
                                          CefLoadHandler.ErrorCode cert_error,
                                          java.lang.String request_url,
                                          CefCallback callback)
        Description copied from interface: CefRequestHandler
        Called on the UI thread to handle requests for URLs with an invalid SSL certificate. If "ignore-certificate-errors" command-line switch is set all invalid certificates will be accepted without calling this method.
        Specified by:
        onCertificateError in interface CefRequestHandler
        Parameters:
        browser - The corresponding browser.
        cert_error - Error code describing the error.
        request_url - The requesting URL.
        callback - Call CefCallback.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.
        Returns:
        True to handle the request (callback must be executed) or false to reject it.
      • getRect

        public java.awt.Rectangle getRect​(CefBrowser browser)
        Description copied from interface: CefWindowHandler
        Retrieve the view rectangle.
        Specified by:
        getRect in interface CefWindowHandler
        Parameters:
        browser - The browser generating the event.
        Returns:
        The view rectangle.
      • onMouseEvent

        public void onMouseEvent​(CefBrowser browser,
                                 int event,
                                 int screenX,
                                 int screenY,
                                 int modifier,
                                 int button)
        Description copied from interface: CefWindowHandler
        Implement this method to handle mouse events on Windows. The method is called in case of the following events: MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED and MOUSE_WHEEL for a horizontal wheel movement.
        Specified by:
        onMouseEvent in interface CefWindowHandler
        Parameters:
        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).
      • getScreenInfo

        public boolean getScreenInfo​(CefBrowser arg0,
                                     CefScreenInfo arg1)
        Description copied from interface: CefRenderHandler
        Retrieve the screen info.
        Specified by:
        getScreenInfo in interface CefRenderHandler
        Parameters:
        arg0 - The browser generating the event.
        arg1 - The screenInfo
        Returns:
        True if this callback was handled. False to fallback to defaults.