Package org.cef.handler
Class CefAppHandlerAdapter
- java.lang.Object
-
- org.cef.handler.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 Summary
Constructors Constructor Description CefAppHandlerAdapter(java.lang.String[] args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CefPrintHandlergetPrintHandler()Return the handler for printing on Linux.voidonBeforeCommandLineProcessing(java.lang.String process_type, CefCommandLine command_line)Provides an opportunity to view and/or modify command-line arguments before processing by CEF and Chromium.booleanonBeforeTerminate()Provides an opportunity to hook into the native shutdown process.voidonContextInitialized()Called on the browser process UI thread immediately after the CEF context has been initialized.voidonRegisterCustomSchemes(CefSchemeRegistrar registrar)Provides an opportunity to register custom schemes.voidonScheduleMessagePumpWork(long delay_ms)Called from any thread when work has been scheduled for the browser process main (UI) thread.voidstateHasChanged(CefApp.CefAppState state)Implement this method to get state changes of the CefApp.
-
-
-
Method Detail
-
onBeforeCommandLineProcessing
public void onBeforeCommandLineProcessing(java.lang.String process_type, CefCommandLine command_line)Description copied from interface:CefAppHandlerProvides 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:
onBeforeCommandLineProcessingin interfaceCefAppHandler- 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:CefAppHandlerProvides 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:
onBeforeTerminatein interfaceCefAppHandler- Returns:
- false to proceed with the default behavior, true to abort terminate.
-
stateHasChanged
public void stateHasChanged(CefApp.CefAppState state)
Description copied from interface:CefAppHandlerImplement this method to get state changes of the CefApp. SeeCefApp.CefAppStatefor 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:
stateHasChangedin interfaceCefAppHandler- Parameters:
state- The current state of CefApp.
-
onRegisterCustomSchemes
public void onRegisterCustomSchemes(CefSchemeRegistrar registrar)
Description copied from interface:CefAppHandlerProvides 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:
onRegisterCustomSchemesin interfaceCefAppHandler
-
onContextInitialized
public void onContextInitialized()
Description copied from interface:CefAppHandlerCalled on the browser process UI thread immediately after the CEF context has been initialized.- Specified by:
onContextInitializedin interfaceCefAppHandler
-
getPrintHandler
public CefPrintHandler getPrintHandler()
Description copied from interface:CefAppHandlerReturn 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:
getPrintHandlerin interfaceCefAppHandler- Returns:
- a reference to a print handler implementation
-
onScheduleMessagePumpWork
public void onScheduleMessagePumpWork(long delay_ms)
Description copied from interface:CefAppHandlerCalled 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:
onScheduleMessagePumpWorkin interfaceCefAppHandler
-
-