internal static CefGeolocationCallback FromNativeOrNull(cef_geolocation_callback_t *ptr)
 {
     if (ptr == null)
     {
         return(null);
     }
     return(new CefGeolocationCallback(ptr));
 }
 private CefGeolocationCallback(cef_geolocation_callback_t *ptr)
 {
     if (ptr == null)
     {
         throw new ArgumentNullException("ptr");
     }
     _self = ptr;
 }
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
        public static int has_one_ref(cef_geolocation_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 int release(cef_geolocation_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));
        }
        public static void add_ref(cef_geolocation_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 void cont(cef_geolocation_callback_t *self, int allow)
        {
            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, allow);
        }
Beispiel #9
0
        private int on_request_geolocation_permission(cef_geolocation_handler_t *self, cef_browser_t *browser, cef_string_t *requesting_url, int request_id, cef_geolocation_callback_t *callback)
        {
            CheckSelf(self);

            var m_browser        = CefBrowser.FromNative(browser);
            var m_requesting_url = cef_string_t.ToString(requesting_url);
            var m_callback       = CefGeolocationCallback.FromNative(callback);

            return(OnRequestGeolocationPermission(m_browser, m_requesting_url, request_id, m_callback));
        }
 internal static CefGeolocationCallback FromNative(cef_geolocation_callback_t *ptr)
 {
     return(new CefGeolocationCallback(ptr));
 }
 private int on_request_geolocation_permission(cef_geolocation_handler_t *self, cef_browser_t *browser, cef_string_t *requesting_url, int request_id, cef_geolocation_callback_t *callback)
 {
     CheckSelf(self);
     throw new NotImplementedException(); // TODO: CefGeolocationHandler.OnRequestGeolocationPermission
 }
Beispiel #12
0
 private CefGeolocationCallback(cef_geolocation_callback_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
        /// <summary>
        /// Called when a page requests permission to access geolocation information.
        /// |requesting_url| is the URL requesting permission and |request_id| is the
        /// unique ID for the permission request. Call
        /// cef_geolocation_callback_t::Continue to allow or deny the permission
        /// request.
        /// </summary>
        private void on_request_geolocation_permission(cef_geolocation_handler_t *self, cef_browser_t *browser, /*const*/ cef_string_t *requesting_url, int request_id, cef_geolocation_callback_t *callback)
        {
            ThrowIfObjectDisposed();

            var m_browser       = CefBrowser.From(browser);
            var m_requestingUrl = cef_string_t.ToString(requesting_url);
            var m_callback      = CefGeolocationCallback.From(callback);

            OnRequestGeolocationPermission(m_browser, m_requestingUrl, request_id, m_callback);
        }