Package org.cef.handler
Class CefJSDialogHandlerAdapter
- java.lang.Object
-
- org.cef.handler.CefJSDialogHandlerAdapter
-
- All Implemented Interfaces:
CefJSDialogHandler
public abstract class CefJSDialogHandlerAdapter extends java.lang.Object implements CefJSDialogHandler
An abstract adapter class for receiving javascript dialog requests. The methods in this class are empty. This class exists as convenience for creating handler objects.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.cef.handler.CefJSDialogHandler
CefJSDialogHandler.JSDialogType
-
-
Constructor Summary
Constructors Constructor Description CefJSDialogHandlerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
onDialogClosed(CefBrowser browser)
Called when the default implementation dialog is closed.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.void
onResetDialogState(CefBrowser browser)
Called to cancel any pending dialogs and reset any saved dialog state.
-
-
-
Method Detail
-
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 interfaceCefJSDialogHandler
- 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 interfaceCefJSDialogHandler
- 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 interfaceCefJSDialogHandler
-
onDialogClosed
public void onDialogClosed(CefBrowser browser)
Description copied from interface:CefJSDialogHandler
Called when the default implementation dialog is closed.- Specified by:
onDialogClosed
in interfaceCefJSDialogHandler
-
-