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

Public Member Functions

 WebBrowserClient (InviwoApplication *app)
 
virtual CefRefPtr< CefLoadHandler > GetLoadHandler () override
 
virtual CefRefPtr< CefRenderHandler > GetRenderHandler () override
 
virtual CefRefPtr< CefRequestHandler > GetRequestHandler () override
 
virtual CefRefPtr< CefDisplayHandler > GetDisplayHandler () override
 
CefRefPtr< CefLifeSpanHandler > GetLifeSpanHandler () override
 
std::shared_ptr< std::function< std::string(const std::string &)> > registerCallback (CefRefPtr< CefBrowser > browser, const std::string &name, std::function< std::string(const std::string &)> 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)
 
void addStaticHandler (int browserId, std::function< bool(const std::string &, scoped_refptr< CefResourceManager::Request >)> handler)
 
void removeStaticHandler (int browserId)
 
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
 
void onNewMessage (CefRefPtr< CefBrowser > browser, std::function< void(cef_log_severity_t, const CefString &, const CefString &, int)> func)
 

Protected Attributes

const PropertyWidgetCEFFactory * widgetFactory_
 
CefRefPtr< RenderHandlerGLrenderHandler_
 Non-owning reference.
 
std::map< int, std::function< void(cef_log_severity_t, const CefString &, const CefString &, int)> > onNewMessage_
 
CefRefPtr< CefMessageRouterBrowserSide > router_
 
CefRefPtr< NetWorkCefSynchronizernetworkSync_
 
std::vector< CefLoadHandler * > loadHandlers_
 
CefRefPtr< CefResourceManager > resourceManager_
 
std::unique_ptr< StringResourceProvider > stringResourceProvider_
 

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()

std::shared_ptr< std::function< std::string(const std::string &)> > inviwo::WebBrowserClient::registerCallback ( CefRefPtr< CefBrowser > browser,
const std::string & name,
std::function< std::string(const std::string &)> 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

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