Implement CefRequestCallback wrapper and expose for relevant CefRequestHandler interfaces

Resolves #982
This commit is contained in:
amaitland
2015-05-07 11:21:55 +10:00
parent 2821227448
commit dc986b3b06
8 changed files with 115 additions and 30 deletions
+15 -3
View File
@@ -12,8 +12,12 @@ namespace CefSharp.Example
return false;
}
bool IRequestHandler.OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl)
bool IRequestHandler.OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl, IRequestCallback callback)
{
//To allow certificate
//callback.Continue(true);
//return true;
return false;
}
@@ -22,7 +26,7 @@ namespace CefSharp.Example
// TODO: Add your own code here for handling scenarios where a plugin crashed, for one reason or another.
}
CefReturnValue IRequestHandler.OnBeforeResourceLoad(IWebBrowser browser, IRequest request, IFrame frame)
CefReturnValue IRequestHandler.OnBeforeResourceLoad(IWebBrowser browser, IRequest request, IFrame frame, IRequestCallback callback)
{
//Note to Redirect simply set the request Url
//if (request.Url.StartsWith("https://www.google.com", StringComparison.OrdinalIgnoreCase))
@@ -30,6 +34,10 @@ namespace CefSharp.Example
// request.Url = "https://github.com/";
//}
//Callback in async fashion
//callback.Continue(true);
//return CefReturnValue.ContinueAsync;
return CefReturnValue.Continue;
}
@@ -53,8 +61,12 @@ namespace CefSharp.Example
// TODO: Add your own code here for handling scenarios where the Render Process terminated for one reason or another.
}
public bool OnQuotaRequest(IWebBrowser browser, string originUrl, long newSize)
public bool OnQuotaRequest(IWebBrowser browser, string originUrl, long newSize, IRequestCallback callback)
{
//Accept Request to raise Quota
//callback.Continue(true);
//return true;
return false;
}