Пример #1
0
 /// <summary>
 /// Called before browser navigation. Return true to cancel the navigation or
 /// false to allow the navigation to proceed. The |request| object cannot be
 /// modified in this callback.
 /// </summary>
 protected virtual bool OnBeforeNavigation(CefBrowser browser, CefFrame frame, CefRequest request, CefNavigationType navigation_type, bool isRedirect)
 {
     return(false);
 }
Пример #2
0
 /// <summary>
 /// Create a new CefRequest object.
 /// </summary>
 public static CefRequest Create()
 {
     return(CefRequest.FromNative(
                cef_request_t.create()
                ));
 }
 /// <summary>
 /// Begin processing the request. To handle the request return true and call
 /// CefCallback::Continue() once the response header information is available
 /// (CefCallback::Continue() can also be called from inside this method if
 /// header information is available immediately). To cancel the request return
 /// false.
 /// </summary>
 protected abstract bool ProcessRequest(CefRequest request, CefCallback callback);
Пример #4
0
 /// <summary>
 /// Return a new resource handler instance to handle the request or an empty
 /// reference to allow default handling of the request. |browser| and |frame|
 /// will be the browser window and frame respectively that originated the
 /// request or NULL if the request did not originate from a browser window
 /// (for example, if the request came from CefURLRequest). The |request| object
 /// passed to this method will not contain cookie data.
 /// </summary>
 protected abstract CefResourceHandler Create(CefBrowser browser, CefFrame frame, string schemeName, CefRequest request);
 /// <summary>
 /// Returns the request object used to create this URL request. The returned
 /// object is read-only and should not be modified.
 /// </summary>
 public CefRequest GetRequest()
 {
     return(CefRequest.FromNative(
                cef_urlrequest_t.get_request(_self)
                ));
 }
Пример #6
0
 /// <summary>
 /// Called on the IO thread when a resource load has completed. |request| and
 /// |response| represent the request and response respectively and cannot be
 /// modified in this callback. |status| indicates the load completion status.
 /// |received_content_length| is the number of response bytes actually read.
 /// </summary>
 protected virtual void OnResourceLoadComplete(CefBrowser browser, CefFrame frame, CefRequest request, CefResponse response, CefUrlRequestStatus status, long receivedContentLength)
 {
 }
Пример #7
0
 /// <summary>
 /// Called on the UI thread before browser navigation. Return true to cancel
 /// the navigation or false to allow the navigation to proceed. The |request|
 /// object cannot be modified in this callback.
 /// CefLoadHandler::OnLoadingStateChange will be called twice in all cases.
 /// If the navigation is allowed CefLoadHandler::OnLoadStart and
 /// CefLoadHandler::OnLoadEnd will be called. If the navigation is canceled
 /// CefLoadHandler::OnLoadError will be called with an |errorCode| value of
 /// ERR_ABORTED.
 /// </summary>
 protected virtual bool OnBeforeBrowse(CefBrowser browser, CefFrame frame, CefRequest request, bool isRedirect)
 {
     return(false);
 }
Пример #8
0
 /// <summary>
 /// Called on the IO thread to optionally filter resource response content.
 /// |request| and |response| represent the request and response respectively
 /// and cannot be modified in this callback.
 /// </summary>
 protected virtual CefResponseFilter GetResourceResponseFilter(CefBrowser browser, CefFrame frame, CefRequest request, CefResponse response)
 {
     return(null);
 }
Пример #9
0
 /// <summary>
 /// Called on the IO thread when a resource response is received. To allow the
 /// resource to load normally return false. To redirect or retry the resource
 /// modify |request| (url, headers or post body) and return true. The
 /// |response| object cannot be modified in this callback.
 /// </summary>
 protected virtual bool OnResourceResponse(CefBrowser browser, CefFrame frame, CefRequest request, CefResponse response)
 {
     return(false);
 }
Пример #10
0
 /// <summary>
 /// Called on the IO thread when a resource load is redirected. The |request|
 /// parameter will contain the old URL and other request-related information.
 /// The |new_url| parameter will contain the new URL and can be changed if
 /// desired. The |request| object cannot be modified in this callback.
 /// </summary>
 protected virtual void OnResourceRedirect(CefBrowser browser, CefFrame frame, CefRequest request, ref string newUrl)
 {
 }
Пример #11
0
 /// <summary>
 /// Called on the IO thread before a resource is loaded. To allow the resource
 /// to load normally return NULL. To specify a handler for the resource return
 /// a CefResourceHandler object. The |request| object should not be modified in
 /// this callback.
 /// </summary>
 protected virtual CefResourceHandler GetResourceHandler(CefBrowser browser, CefFrame frame, CefRequest request)
 {
     return(null);
 }
Пример #12
0
 /// <summary>
 /// Called on the IO thread before a resource request is loaded. The |request|
 /// object may be modified. Return RV_CONTINUE to continue the request
 /// immediately. Return RV_CONTINUE_ASYNC and call CefRequestCallback::
 /// Continue() at a later time to continue or cancel the request
 /// asynchronously. Return RV_CANCEL to cancel the request immediately.
 /// </summary>
 protected virtual CefReturnValue OnBeforeResourceLoad(CefBrowser browser, CefFrame frame, CefRequest request, CefRequestCallback callback)
 {
     return(CefReturnValue.Continue);
 }