Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::WebBrowserClient Class Reference
+ Inheritance diagram for inviwo::WebBrowserClient:

Classes

struct  BrowserData
 

Public Member Functions

 WebBrowserClient (ModuleManager &moduleManager, const PropertyWidgetCEFFactory *widgetFactory)
 
virtual CefRefPtr< CefLoadHandler > GetLoadHandler () override
 
virtual CefRefPtr< CefRenderHandler > GetRenderHandler () override
 
virtual CefRefPtr< CefRequestHandler > GetRequestHandler () override
 
virtual CefRefPtr< CefDisplayHandler > GetDisplayHandler () override
 
CefRefPtr< CefLifeSpanHandler > GetLifeSpanHandler () override
 
void setBrowserParent (CefRefPtr< CefBrowser > browser, Processor *parent)
 
void removeBrowserParent (CefRefPtr< CefBrowser > browser)
 
ProcessorCefSynchronizer::CallbackHandle registerCallback (CefRefPtr< CefBrowser > browser, const std::string &name, std::function< ProcessorCefSynchronizer::CallbackFunc > callback)
 
virtual bool OnProcessMessageReceived (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefProcessId source_process, CefRefPtr< CefProcessMessage > message) override
 
virtual void OnAfterCreated (CefRefPtr< CefBrowser > browser) override
 
virtual bool DoClose (CefRefPtr< CefBrowser > browser) override
 
virtual void OnBeforeClose (CefRefPtr< CefBrowser > browser) override
 
virtual CefRefPtr< CefResourceRequestHandler > GetResourceRequestHandler (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request, bool is_navigation, bool is_download, const CefString &request_initiator, bool &disable_default_handling) override
 
virtual bool OnBeforeBrowse (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request, bool user_gesture, bool is_redirect) override
 
virtual void OnRenderProcessTerminated (CefRefPtr< CefBrowser > browser, TerminationStatus status, int error_code, const CefString &error_string) override
 
void addLoadHandler (CefLoadHandler *loadHandler)
 
void removeLoadHandler (CefLoadHandler *loadHandler)
 
virtual void OnLoadingStateChange (CefRefPtr< CefBrowser > browser, bool isLoading, bool canGoBack, bool canGoForward) override
 
virtual void OnLoadStart (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, TransitionType transition_type) override
 
virtual void OnLoadEnd (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, int httpStatusCode) override
 
virtual void OnLoadError (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefLoadHandler::ErrorCode errorCode, const CefString &errorText, const CefString &failedUrl) override
 
virtual bool OnConsoleMessage (CefRefPtr< CefBrowser > browser, cef_log_severity_t level, const CefString &message, const CefString &source, int line) override
 
virtual ReturnValue OnBeforeResourceLoad (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request, CefRefPtr< CefCallback > callback) override
 
virtual CefRefPtr< CefResourceHandler > GetResourceHandler (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request) override
 

Protected Attributes

std::map< int, BrowserDatabrowserParents_
 
std::map< int, std::unique_ptr< PropertyCefSynchronizer > > propertyCefSynchronizers_
 Owner of each browser.
 
const PropertyWidgetCEFFactorywidgetFactory_
 One synchronizer per browser.
 
CefRefPtr< RenderHandlerGLrenderHandler_
 Non-owning reference.
 
CefRefPtr< CefMessageRouterBrowserSide > messageRouter_
 
std::vector< CefLoadHandler * > loadHandlers_
 
CefRefPtr< CefResourceManager > resourceManager_
 
int browserCount_ = 0
 

Member Function Documentation

◆ OnLoadEnd()

virtual void inviwo::WebBrowserClient::OnLoadEnd ( CefRefPtr< CefBrowser > browser,
CefRefPtr< CefFrame > frame,
int httpStatusCode )
overridevirtual

Synchronizes all widgets and sets their frame, called when frame has loaded.

◆ registerCallback()

ProcessorCefSynchronizer::CallbackHandle inviwo::WebBrowserClient::registerCallback ( CefRefPtr< CefBrowser > browser,
const std::string & name,
std::function< ProcessorCefSynchronizer::CallbackFunc > callback )

Register a processor callback for a specific browser which can be triggered through a cefQuery request where the 'command' is 'callback' and 'name' refers to name in the JSON object. The callback will then be called with the string payload given by 'data'.

Note: setBrowserParent() must have been called before.

{"command": "callback", "callback": "name", "data": "string payload"}
See also
ProcessorCefSynchronizer::registerCallback, setBrowserParent

◆ removeBrowserParent()

void inviwo::WebBrowserClient::removeBrowserParent ( CefRefPtr< CefBrowser > browser)

Removes Processor parent associated with the provided browser. Processor invalidation will not be called on repaints after removing the processor. Will do nothing if browser has no assoicated Processor.

Parameters
browserto remove processor association from.

◆ setBrowserParent()

void inviwo::WebBrowserClient::setBrowserParent ( CefRefPtr< CefBrowser > browser,
Processor * parent )

Enable invalidation when the web page repaints and allow the Inviwo javascript API to access the parent processor. Connection will be removed when the browser closes or removeBrowserParent is called. A browser can only have one Processor as parent.

Parameters
browserto be associated with a processor.
parentweb browser processor responsible for the browser. Cannot be null.
See also
ProcessorCefSynchronizer

The documentation for this class was generated from the following file: