Class CefAppHandlerAdapter

  • All Implemented Interfaces:
    CefAppHandler
    Direct Known Subclasses:
    CefApp

    public abstract class CefAppHandlerAdapter
    extends java.lang.Object
    implements CefAppHandler
    An abstract adapter class for managing app handler events. The methods in this class are using a default implementation. This class exists as convenience for creating handler objects.
    • Constructor Detail

      • CefAppHandlerAdapter

        public CefAppHandlerAdapter​(java.lang.String[] args)
    • Method Detail

      • onBeforeCommandLineProcessing

        public void onBeforeCommandLineProcessing​(java.lang.String process_type,
                                                  CefCommandLine command_line)
        Description copied from interface: CefAppHandler
        Provides an opportunity to view and/or modify command-line arguments before processing by CEF and Chromium. The |process_type| value will be empty for the browser process. Be cautious when using this method to modify command-line arguments for non-browser processes as this may result in undefined behavior including crashes.
        Specified by:
        onBeforeCommandLineProcessing in interface CefAppHandler
        Parameters:
        process_type - type of process (empty for browser process).
        command_line - values of the command line.
      • onBeforeTerminate

        public boolean onBeforeTerminate()
        Description copied from interface: CefAppHandler
        Provides an opportunity to hook into the native shutdown process. This method is invoked if the user tries to terminate the app by sending the corresponding key code (e.g. on Mac: CMD+Q) or something similar. If you want to proceed with the default behavior of the native system, return false. If you want to abort the terminate or if you want to implement your own shutdown sequence return true and do the cleanup on your own.
        Specified by:
        onBeforeTerminate in interface CefAppHandler
        Returns:
        false to proceed with the default behavior, true to abort terminate.
      • stateHasChanged

        public void stateHasChanged​(CefApp.CefAppState state)
        Description copied from interface: CefAppHandler
        Implement this method to get state changes of the CefApp. See CefApp.CefAppState for a complete list of possible states. For example, this method can be used e.g. to get informed if CefApp has completed its initialization or its shutdown process.
        Specified by:
        stateHasChanged in interface CefAppHandler
        Parameters:
        state - The current state of CefApp.
      • onRegisterCustomSchemes

        public void onRegisterCustomSchemes​(CefSchemeRegistrar registrar)
        Description copied from interface: CefAppHandler
        Provides an opportunity to register custom schemes. Do not keep a reference to the |registrar| object. This method is called on the main thread for each process and the registered schemes should be the same across all processes.
        Specified by:
        onRegisterCustomSchemes in interface CefAppHandler
      • onContextInitialized

        public void onContextInitialized()
        Description copied from interface: CefAppHandler
        Called on the browser process UI thread immediately after the CEF context has been initialized.
        Specified by:
        onContextInitialized in interface CefAppHandler
      • getPrintHandler

        public CefPrintHandler getPrintHandler()
        Description copied from interface: CefAppHandler
        Return the handler for printing on Linux. If a print handler is not provided then printing will not be supported on the Linux platform.
        Specified by:
        getPrintHandler in interface CefAppHandler
        Returns:
        a reference to a print handler implementation
      • onScheduleMessagePumpWork

        public void onScheduleMessagePumpWork​(long delay_ms)
        Description copied from interface: CefAppHandler
        Called from any thread when work has been scheduled for the browser process main (UI) thread. This callback should schedule a CefApp.DoMessageLoopWork() call to happen on the main (UI) thread. |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0 then the call should happen reasonably soon. If |delay_ms| is > 0 then the call should be scheduled to happen after the specified delay and any currently pending scheduled call should be cancelled.
        Specified by:
        onScheduleMessagePumpWork in interface CefAppHandler