示例#1
0
 internal static CefAuthCallback FromNativeOrNull(cef_auth_callback_t *ptr)
 {
     if (ptr == null)
     {
         return(null);
     }
     return(new CefAuthCallback(ptr));
 }
示例#2
0
 private CefAuthCallback(cef_auth_callback_t *ptr)
 {
     if (ptr == null)
     {
         throw new ArgumentNullException("ptr");
     }
     _self = ptr;
 }
示例#3
0
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
示例#4
0
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
        public static void cancel(cef_auth_callback_t *self)
        {
            cancel_delegate d;
            var             p = self->_cancel;

            if (p == _p4)
            {
                d = _d4;
            }
            else
            {
                d = (cancel_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cancel_delegate));
                if (_p4 == IntPtr.Zero)
                {
                    _d4 = d; _p4 = p;
                }
            }
            d(self);
        }
        public static void cont(cef_auth_callback_t *self, cef_string_t *username, cef_string_t *password)
        {
            cont_delegate d;
            var           p = self->_cont;

            if (p == _p3)
            {
                d = _d3;
            }
            else
            {
                d = (cont_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cont_delegate));
                if (_p3 == IntPtr.Zero)
                {
                    _d3 = d; _p3 = p;
                }
            }
            d(self, username, password);
        }
        public static int has_one_ref(cef_auth_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));
        }
        public static void add_ref(cef_auth_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);
        }
        public static int release(cef_auth_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));
        }
        private int get_auth_credentials(cef_urlrequest_client_t *self, int isProxy, cef_string_t *host, int port, cef_string_t *realm, cef_string_t *scheme, cef_auth_callback_t *callback)
        {
            CheckSelf(self);

            var m_isProxy  = isProxy != 0;
            var m_host     = cef_string_t.ToString(host);
            var m_realm    = cef_string_t.ToString(realm);
            var m_scheme   = cef_string_t.ToString(scheme);
            var m_callback = CefAuthCallback.FromNative(callback);

            var m_result = GetAuthCredentials(m_isProxy, m_host, port, m_realm, m_scheme, m_callback);

            return(m_result ? 1 : 0);
        }
示例#11
0
        private int get_auth_credentials(cef_request_handler_t *self, 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)
        {
            CheckSelf(self);

            var m_browser  = CefBrowser.FromNative(browser);
            var m_frame    = CefFrame.FromNative(frame);
            var m_host     = cef_string_t.ToString(host);
            var m_realm    = cef_string_t.ToString(realm);
            var m_scheme   = cef_string_t.ToString(scheme);
            var m_callback = CefAuthCallback.FromNative(callback);

            var result = GetAuthCredentials(m_browser, m_frame, isProxy != 0, m_host, port, m_realm, m_scheme, m_callback);

            return(result ? 1 : 0);
        }
示例#12
0
        /// <summary>
        /// Called when some part of the response is read. |data| contains the current
        /// bytes received since the last call. This method will not be called if the
        /// UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request.
        /// </summary>
        // protected abstract void OnDownloadData(cef_urlrequest_t* request, void* data, UIntPtr data_length);

        private int get_auth_credentials(cef_urlrequest_client_t *self, int isProxy, cef_string_t *host, int port, cef_string_t *realm, cef_string_t *scheme, cef_auth_callback_t *callback)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefUrlRequestClient.GetAuthCredentials
        }
示例#13
0
 public unsafe int GetAuthCredentials(cef_browser_t *browser, [Immutable] cef_string_t *origin_url, int isProxy, [Immutable] cef_string_t *host, int port, [Immutable] cef_string_t *realm, [Immutable] cef_string_t *scheme, cef_auth_callback_t *callback)
 {
     fixed(cef_request_handler_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_request_handler_t *, cef_browser_t *, cef_string_t *, int, cef_string_t *, int, cef_string_t *, cef_string_t *, cef_auth_callback_t *, int >)get_auth_credentials)(self, browser, origin_url, isProxy, host, port, realm, scheme, callback));
     }
 }
示例#14
0
 internal static CefAuthCallback FromNative(cef_auth_callback_t *ptr)
 {
     return(new CefAuthCallback(ptr));
 }
示例#15
0
 public unsafe extern int GetAuthCredentials(int isProxy, [Immutable] cef_string_t *host, int port, [Immutable] cef_string_t *realm, [Immutable] cef_string_t *scheme, cef_auth_callback_t *callback);
示例#16
0
 public CefAuthCallback(cef_auth_callback_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
示例#17
0
 private CefAuthCallback(cef_auth_callback_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
示例#18
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 abstract int OnResourceResponse(cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request, cef_response_t* response);

        private int get_auth_credentials(cef_request_handler_t *self, 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)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefRequestHandler.GetAuthCredentials
        }