Package org.cef.handler
Class CefRequestContextHandlerAdapter
- java.lang.Object
-
- org.cef.handler.CefRequestContextHandlerAdapter
-
- All Implemented Interfaces:
CefRequestContextHandler
public abstract class CefRequestContextHandlerAdapter extends java.lang.Object implements CefRequestContextHandler
An abstract adapter class for receiving browser request context events. The methods in this class are empty. This class exists as convenience for creating handler objects.
-
-
Constructor Summary
Constructors Constructor Description CefRequestContextHandlerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CefResourceRequestHandler
getResourceRequestHandler(CefBrowser browser, CefFrame frame, CefRequest request, boolean isNavigation, boolean isDownload, java.lang.String requestInitiator, BoolRef disableDefaultHandling)
Called on the IO thread before a resource request is initiated.boolean
onBeforePluginLoad(java.lang.String mime_type, java.lang.String plugin_url, boolean is_main_frame, java.lang.String top_origin_url, CefWebPluginInfo plugin_info)
Called on multiple browser process threads before a plugin instance is loaded.
-
-
-
Method Detail
-
onBeforePluginLoad
public boolean onBeforePluginLoad(java.lang.String mime_type, java.lang.String plugin_url, boolean is_main_frame, java.lang.String top_origin_url, CefWebPluginInfo plugin_info)
Description copied from interface:CefRequestContextHandler
Called on multiple browser process threads before a plugin instance is loaded.- Specified by:
onBeforePluginLoad
in interfaceCefRequestContextHandler
- Parameters:
mime_type
- is the mime type of the plugin that will be loaded.plugin_url
- is the content URL that the plugin will load and may be empty.is_main_frame
- will be true if the plugin is being loaded in the main (top-level) frame.top_origin_url
- is the URL for the top-level frame that contains the plugin when loading a specific plugin instance or empty when building the initial list of enabled plugins for 'navigator.plugins' JavaScript state.plugin_info
- includes additional information about the plugin that will be loaded. |plugin_policy| is the recommended policy.- Returns:
- true to block loading of the plugin.
-
getResourceRequestHandler
public CefResourceRequestHandler getResourceRequestHandler(CefBrowser browser, CefFrame frame, CefRequest request, boolean isNavigation, boolean isDownload, java.lang.String requestInitiator, BoolRef disableDefaultHandling)
Description copied from interface:CefRequestContextHandler
Called on the IO thread before a resource request is initiated. The |browser| and |frame| values represent the source of the request. This method will not be called if the client associated with |browser| returns a non-null value from CefRequestHandler.getResourceRequestHandler for the same request (identified by CefRequest.getIdentifier).- Specified by:
getResourceRequestHandler
in interfaceCefRequestContextHandler
- 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.
-
-