@@ -15,7 +15,8 @@ class ClientHandler :
1515 public CefLifeSpanHandler,
1616 public CefDisplayHandler,
1717 public CefKeyboardHandler,
18- public CefRequestHandler
18+ public CefRequestHandler,
19+ public CefLoadHandler
1920{
2021public:
2122 ClientHandler (){}
@@ -111,7 +112,7 @@ class ClientHandler :
111112 // /
112113 /* --cef()--*/
113114 virtual CefRefPtr<CefLoadHandler> GetLoadHandler () OVERRIDE {
114- return NULL ;
115+ return this ;
115116 }
116117
117118 // /
@@ -477,6 +478,70 @@ class ClientHandler :
477478 const CefString& request_url,
478479 CefRefPtr<CefAllowCertificateErrorCallback> callback) OVERRIDE;
479480
481+ // --------------------------------------------------------------------------
482+ // CefLoadHandler
483+ // --------------------------------------------------------------------------
484+
485+ // /
486+ // Implement this interface to handle events related to browser load status.
487+ // The methods of this class will be called on the UI thread.
488+ // /
489+
490+ // /
491+ // Called when the browser begins loading a frame. The |frame| value will
492+ // never be empty -- call the IsMain() method to check if this frame is the
493+ // main frame. Multiple frames may be loading at the same time. Sub-frames may
494+ // start or continue loading after the main frame load has ended. This method
495+ // may not be called for a particular frame if the load request for that frame
496+ // fails.
497+ // /
498+ /* --cef()--*/
499+ virtual void OnLoadStart (CefRefPtr<CefBrowser> browser,
500+ CefRefPtr<CefFrame> frame) OVERRIDE;
501+
502+ // /
503+ // Called when the browser is done loading a frame. The |frame| value will
504+ // never be empty -- call the IsMain() method to check if this frame is the
505+ // main frame. Multiple frames may be loading at the same time. Sub-frames may
506+ // start or continue loading after the main frame load has ended. This method
507+ // will always be called for all frames irrespective of whether the request
508+ // completes successfully.
509+ // /
510+ /* --cef()--*/
511+ virtual void OnLoadEnd (CefRefPtr<CefBrowser> browser,
512+ CefRefPtr<CefFrame> frame,
513+ int httpStatusCode) OVERRIDE;
514+
515+ // /
516+ // Called when the browser fails to load a resource. |errorCode| is the error
517+ // code number, |errorText| is the error text and and |failedUrl| is the URL
518+ // that failed to load. See net\base\net_error_list.h for complete
519+ // descriptions of the error codes.
520+ // /
521+ /* --cef(optional_param=errorText)--*/
522+ virtual void OnLoadError (CefRefPtr<CefBrowser> browser,
523+ CefRefPtr<CefFrame> frame,
524+ cef_errorcode_t errorCode,
525+ const CefString& errorText,
526+ const CefString& failedUrl) OVERRIDE;
527+
528+ // /
529+ // Called when the render process terminates unexpectedly. |status| indicates
530+ // how the process terminated.
531+ // /
532+ /* --cef()--*/
533+ virtual void OnRenderProcessTerminated (CefRefPtr<CefBrowser> browser,
534+ cef_termination_status_t status)
535+ OVERRIDE;
536+
537+ // /
538+ // Called when a plugin has crashed. |plugin_path| is the path of the plugin
539+ // that crashed.
540+ // /
541+ /* --cef()--*/
542+ virtual void OnPluginCrashed (CefRefPtr<CefBrowser> browser,
543+ const CefString& plugin_path) OVERRIDE;
544+
480545private:
481546
482547 // Include the default reference counting implementation.
0 commit comments