Esempio n. 1
0
        public static int release(cef_request_callback_t *self)
        {
            release_delegate d;
            var p = self->_base._release;

            if (p == _p1)
            {
                d = _d1;
            }
            else
            {
                d = (release_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(release_delegate));
                if (_p1 == IntPtr.Zero)
                {
                    _d1 = d; _p1 = p;
                }
            }
            return(d(self));
        }
Esempio n. 2
0
        public static int has_one_ref(cef_request_callback_t *self)
        {
            has_one_ref_delegate d;
            var p = self->_base._has_one_ref;

            if (p == _p2)
            {
                d = _d2;
            }
            else
            {
                d = (has_one_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(has_one_ref_delegate));
                if (_p2 == IntPtr.Zero)
                {
                    _d2 = d; _p2 = p;
                }
            }
            return(d(self));
        }
Esempio n. 3
0
        public static void add_ref(cef_request_callback_t *self)
        {
            add_ref_delegate d;
            var p = self->_base._add_ref;

            if (p == _p0)
            {
                d = _d0;
            }
            else
            {
                d = (add_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_ref_delegate));
                if (_p0 == IntPtr.Zero)
                {
                    _d0 = d; _p0 = p;
                }
            }
            d(self);
        }
Esempio n. 4
0
        public static void cancel(cef_request_callback_t *self)
        {
            cancel_delegate d;
            var             p = self->_cancel;

            if (p == _p5)
            {
                d = _d5;
            }
            else
            {
                d = (cancel_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cancel_delegate));
                if (_p5 == IntPtr.Zero)
                {
                    _d5 = d; _p5 = p;
                }
            }
            d(self);
        }
Esempio n. 5
0
        public static void cont(cef_request_callback_t *self, int allow)
        {
            cont_delegate d;
            var           p = self->_cont;

            if (p == _p4)
            {
                d = _d4;
            }
            else
            {
                d = (cont_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cont_delegate));
                if (_p4 == IntPtr.Zero)
                {
                    _d4 = d; _p4 = p;
                }
            }
            d(self, allow);
        }
Esempio n. 6
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);
        }
Esempio n. 7
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);
        }
Esempio n. 8
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);
        }
Esempio n. 9
0
 public unsafe CefReturnValue OnBeforeResourceLoad(cef_browser_t *browser, cef_frame_t *frame, cef_request_t *request, cef_request_callback_t *callback)
 {
     fixed(cef_resource_request_handler_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_resource_request_handler_t *, cef_browser_t *, cef_frame_t *, cef_request_t *, cef_request_callback_t *, CefReturnValue >)on_before_resource_load)(self, browser, frame, request, callback));
     }
 }
Esempio n. 10
0
 public CefRequestCallback(cef_request_callback_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
Esempio n. 11
0
 public unsafe extern int OnCertificateError(cef_browser_t *browser, CefErrorCode cert_error, [Immutable] cef_string_t *request_url, cef_sslinfo_t *ssl_info, cef_request_callback_t *callback);
Esempio n. 12
0
 static public CefRequestCallback FromOutVal(cef_request_callback_t *ptr) => FromOutVal((IntPtr)ptr, (p2) => new CefRequestCallback(p2, false));
 internal static CefRequestCallback FromNative(cef_request_callback_t *ptr)
 {
     return(new CefRequestCallback(ptr));
 }
Esempio n. 14
0
 public unsafe int OnQuotaRequest(cef_browser_t *browser, [Immutable] cef_string_t *origin_url, long new_size, cef_request_callback_t *callback)
 {
     fixed(cef_request_handler_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_request_handler_t *, cef_browser_t *, cef_string_t *, long, cef_request_callback_t *, int >)on_quota_request)(self, browser, origin_url, new_size, callback));
     }
 }
Esempio n. 15
0
        /// <summary>
        /// Called on the UI thread before OnBeforeBrowse in certain limited cases
        /// where navigating a new or different browser might be desirable. This
        /// includes user-initiated navigation that might open in a special way (e.g.
        /// links clicked via middle-click or ctrl + left-click) and certain types of
        /// cross-origin navigation initiated from the renderer process (e.g.
        /// navigating the top-level frame to/from a file URL). The |browser| and
        /// |frame| values represent the source of the navigation. The
        /// |target_disposition| value indicates where the user intended to navigate
        /// the browser based on standard Chromium behaviors (e.g. current tab,
        /// new tab, etc). The |user_gesture| value will be true if the browser
        /// navigated via explicit user gesture (e.g. clicking a link) or false if it
        /// navigated automatically (e.g. via the DomContentLoaded event). Return true
        /// to cancel the navigation or false to allow the navigation to proceed in the
        /// source browser's top-level frame.
        /// </summary>
        // protected abstract int OnOpenURLFromTab(cef_browser_t* browser, cef_frame_t* frame, cef_string_t* target_url, CefWindowOpenDisposition target_disposition, int user_gesture);

        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);
            throw new NotImplementedException(); // TODO: CefRequestHandler.OnBeforeResourceLoad
        }
Esempio n. 16
0
        /// <summary>
        /// Called on the UI thread to handle requests for URLs with an unknown
        /// protocol component. Set |allow_os_execution| to true to attempt execution
        /// via the registered OS protocol handler, if any.
        /// SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED
        /// ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
        /// </summary>
        // protected abstract void OnProtocolExecution(cef_browser_t* browser, cef_string_t* url, int* allow_os_execution);

        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);
            throw new NotImplementedException(); // TODO: CefRequestHandler.OnCertificateError
        }
Esempio n. 17
0
        /// <summary>
        /// Called on the IO thread when the browser needs credentials from the user.
        /// |isProxy| indicates whether the host is a proxy server. |host| contains the
        /// hostname and |port| contains the port number. Return true to continue the
        /// request and call CefAuthCallback::Continue() either in this method or
        /// at a later time when the authentication information is available. Return
        /// false to cancel the request immediately.
        /// </summary>
        // protected abstract int GetAuthCredentials(cef_browser_t* browser, cef_frame_t* frame, int isProxy, cef_string_t* host, int port, cef_string_t* realm, cef_string_t* scheme, cef_auth_callback_t* callback);

        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);
            throw new NotImplementedException(); // TODO: CefRequestHandler.OnQuotaRequest
        }
Esempio n. 18
0
 public unsafe int OnCertificateError(cef_browser_t *browser, CefErrorCode cert_error, [Immutable] cef_string_t *request_url, cef_sslinfo_t *ssl_info, cef_request_callback_t *callback)
 {
     fixed(cef_request_handler_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_request_handler_t *, cef_browser_t *, CefErrorCode, cef_string_t *, cef_sslinfo_t *, cef_request_callback_t *, int >)on_certificate_error)(self, browser, cert_error, request_url, ssl_info, callback));
     }
 }
Esempio n. 19
0
 public unsafe extern int OnQuotaRequest(cef_browser_t *browser, [Immutable] cef_string_t *origin_url, long new_size, cef_request_callback_t *callback);
Esempio n. 20
0
 public unsafe extern CefReturnValue OnBeforeResourceLoad(cef_browser_t *browser, cef_frame_t *frame, cef_request_t *request, cef_request_callback_t *callback);
Esempio n. 21
0
 static public CefRequestCallback FromInArg(cef_request_callback_t *ptr) => FromInArg((IntPtr)ptr, (p2) => new CefRequestCallback(p2));