Exemple #1
0
        private int on_quota_request(cef_request_handler_t *self, cef_browser_t *browser, cef_string_t *origin_url, long new_size, cef_request_callback_t *callback)
        {
            CheckSelf(self);

            var m_browser    = CefBrowser.FromNative(browser);
            var m_origin_url = cef_string_t.ToString(origin_url);
            var m_callback   = CefRequestCallback.FromNative(callback);

            var result = OnQuotaRequest(m_browser, m_origin_url, new_size, m_callback);

            return(result ? 1 : 0);
        }
Exemple #2
0
        private int on_certificate_error(cef_request_handler_t *self, cef_browser_t *browser, CefErrorCode cert_error, cef_string_t *request_url, cef_sslinfo_t *ssl_info, cef_request_callback_t *callback)
        {
            CheckSelf(self);

            var m_browser     = CefBrowser.FromNative(browser);
            var m_request_url = cef_string_t.ToString(request_url);
            var m_ssl_info    = CefSslInfo.FromNative(ssl_info);
            var m_callback    = CefRequestCallback.FromNativeOrNull(callback);

            var result = OnCertificateError(m_browser, cert_error, m_request_url, m_ssl_info, m_callback);

            return(result ? 1 : 0);
        }
Exemple #3
0
        private CefReturnValue on_before_resource_load(cef_request_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_request_t *request, cef_request_callback_t *callback)
        {
            CheckSelf(self);

            var m_browser  = CefBrowser.FromNative(browser);
            var m_frame    = CefFrame.FromNative(frame);
            var m_request  = CefRequest.FromNative(request);
            var m_callback = CefRequestCallback.FromNative(callback);

            var result = OnBeforeResourceLoad(m_browser, m_frame, m_request, m_callback);

            if (result != CefReturnValue.ContinueAsync)
            {
                m_browser.Dispose();
                m_frame.Dispose();
                m_request.Dispose();
                m_callback.Dispose();
            }

            return(result);
        }
Exemple #4
0
 /// <summary>
 /// Called on the UI thread to handle requests for URLs with an invalid
 /// SSL certificate. Return true and call CefRequestCallback::Continue() either
 /// in this method or at a later time to continue or cancel the request. Return
 /// false to cancel the request immediately. If
 /// CefSettings.ignore_certificate_errors is set all invalid certificates will
 /// be accepted without calling this method.
 /// </summary>
 protected virtual bool OnCertificateError(CefBrowser browser, CefErrorCode certError, string requestUrl, CefSslInfo sslInfo, CefRequestCallback callback)
 {
     return(false);
 }
Exemple #5
0
 /// <summary>
 /// Called on the IO thread when JavaScript requests a specific storage quota
 /// size via the webkitStorageInfo.requestQuota function. |origin_url| is the
 /// origin of the page making the request. |new_size| is the requested quota
 /// size in bytes. Return true to continue the request and call
 /// CefRequestCallback::Continue() either in this method or at a later time to
 /// grant or deny the request. Return false to cancel the request immediately.
 /// </summary>
 protected virtual bool OnQuotaRequest(CefBrowser browser, string originUrl, long newSize, CefRequestCallback callback)
 {
     callback.Continue(true);
     return(true);
 }
Exemple #6
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);
 }