Package org.cef.handler
Interface CefLifeSpanHandler
-
- All Known Implementing Classes:
CefClient
,CefLifeSpanHandlerAdapter
public interface CefLifeSpanHandler
Implement this interface to handle events related to browser life span. The methods of this class will be called on the UI thread unless otherwise indicated.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
doClose(CefBrowser browser)
Called when a browser has received a request to close.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.void
onBeforeClose(CefBrowser browser)
Called just before a browser is destroyed.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.
-
-
-
Method Detail
-
onBeforePopup
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.- 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.
-
onAfterCreated
void onAfterCreated(CefBrowser browser)
Handle creation of a new browser window.- Parameters:
browser
- The browser generating the event.
-
onAfterParentChanged
void onAfterParentChanged(CefBrowser browser)
Called after a browser's native parent window has changed.- Parameters:
browser
- The browser generating the event.
-
doClose
boolean doClose(CefBrowser browser)
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.- Parameters:
browser
- The browser generating the event.- Returns:
- False to send an OS close notification to the browser window's top-level owner.
-
onBeforeClose
void onBeforeClose(CefBrowser browser)
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.- Parameters:
browser
- The browser generating the event.
-
-