Ejemplo n.º 1
0
 internal static CefJSDialogCallback FromNativeOrNull(cef_jsdialog_callback_t *ptr)
 {
     if (ptr == null)
     {
         return(null);
     }
     return(new CefJSDialogCallback(ptr));
 }
Ejemplo n.º 2
0
 private CefJSDialogCallback(cef_jsdialog_callback_t *ptr)
 {
     if (ptr == null)
     {
         throw new ArgumentNullException("ptr");
     }
     _self = ptr;
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
Ejemplo n.º 4
0
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
        public static void cont(cef_jsdialog_callback_t *self, int success, cef_string_t *user_input)
        {
            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, success, user_input);
        }
        public static int has_one_ref(cef_jsdialog_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_jsdialog_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_jsdialog_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 on_jsdialog(cef_jsdialog_handler_t *self, cef_browser_t *browser, cef_string_t *origin_url, cef_string_t *accept_lang, CefJSDialogType dialog_type, cef_string_t *message_text, cef_string_t *default_prompt_text, cef_jsdialog_callback_t *callback, int *suppress_message)
 {
     CheckSelf(self);
     throw new NotImplementedException(); // TODO: CefJSDialogHandler.OnJSDialog
 }
Ejemplo n.º 10
0
 public unsafe int OnJSDialog(cef_browser_t *browser, [Immutable] cef_string_t *origin_url, CefJSDialogType dialog_type, [Immutable] cef_string_t *message_text, [Immutable] cef_string_t *default_prompt_text, cef_jsdialog_callback_t *callback, int *suppress_message)
 {
     fixed(cef_jsdialog_handler_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_jsdialog_handler_t *, cef_browser_t *, cef_string_t *, CefJSDialogType, cef_string_t *, cef_string_t *, cef_jsdialog_callback_t *, int *, int >)on_jsdialog)(self, browser, origin_url, dialog_type, message_text, default_prompt_text, callback, suppress_message));
     }
 }
Ejemplo n.º 11
0
 public unsafe int OnBeforeUnloadDialog(cef_browser_t *browser, [Immutable] cef_string_t *message_text, int is_reload, cef_jsdialog_callback_t *callback)
 {
     fixed(cef_jsdialog_handler_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_jsdialog_handler_t *, cef_browser_t *, cef_string_t *, int, cef_jsdialog_callback_t *, int >)on_before_unload_dialog)(self, browser, message_text, is_reload, callback));
     }
 }
Ejemplo n.º 12
0
 internal static CefJSDialogCallback FromNative(cef_jsdialog_callback_t *ptr)
 {
     return(new CefJSDialogCallback(ptr));
 }
Ejemplo n.º 13
0
        private int on_before_unload_dialog(cef_jsdialog_handler_t *self, cef_browser_t *browser, cef_string_t *message_text, int is_reload, cef_jsdialog_callback_t *callback)
        {
            CheckSelf(self);

            var m_browser      = CefBrowser.FromNative(browser);
            var m_message_text = cef_string_t.ToString(message_text);
            var m_callback     = CefJSDialogCallback.FromNative(callback);

            return(OnBeforeUnloadDialog(m_browser, m_message_text, is_reload != 0, m_callback) ? 1 : 0);
        }
Ejemplo n.º 14
0
        private int on_jsdialog(cef_jsdialog_handler_t *self, cef_browser_t *browser, cef_string_t *origin_url, cef_string_t *accept_lang, CefJSDialogType dialog_type, cef_string_t *message_text, cef_string_t *default_prompt_text, cef_jsdialog_callback_t *callback, int *suppress_message)
        {
            CheckSelf(self);

            var  m_browser             = CefBrowser.FromNative(browser);
            var  m_origin_url          = cef_string_t.ToString(origin_url);
            var  m_accept_lang         = cef_string_t.ToString(accept_lang);
            var  m_message_text        = cef_string_t.ToString(message_text);
            var  m_default_prompt_text = cef_string_t.ToString(default_prompt_text);
            var  m_callback            = CefJSDialogCallback.FromNative(callback);
            bool m_suppress_message;

            var result = OnJSDialog(m_browser, m_origin_url, m_accept_lang, dialog_type, m_message_text, m_default_prompt_text, m_callback, out m_suppress_message);

            *suppress_message = m_suppress_message ? 1 : 0;
            return(result ? 1 : 0);
        }
        /// <summary>
        /// Called to run a JavaScript dialog. The |default_prompt_text| value will be
        /// specified for prompt dialogs only. Set |suppress_message| to true and
        /// return false to suppress the message (suppressing messages is preferable
        /// to immediately executing the callback as this is used to detect presumably
        /// malicious behavior like spamming alert messages in onbeforeunload). Set
        /// |suppress_message| to false and return false to use the default
        /// implementation (the default implementation will show one modal dialog at a
        /// time and suppress any additional dialog requests until the displayed dialog
        /// is dismissed). Return true if the application will use a custom dialog or
        /// if the callback has been executed immediately. Custom dialogs may be either
        /// modal or modeless. If a custom dialog is used the application must execute
        /// |callback| once the custom dialog is dismissed.
        /// </summary>
        // protected abstract int OnJSDialog(cef_browser_t* browser, cef_string_t* origin_url, cef_string_t* accept_lang, CefJSDialogType dialog_type, cef_string_t* message_text, cef_string_t* default_prompt_text, cef_jsdialog_callback_t* callback, int* suppress_message);

        private int on_before_unload_dialog(cef_jsdialog_handler_t *self, cef_browser_t *browser, cef_string_t *message_text, int is_reload, cef_jsdialog_callback_t *callback)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefJSDialogHandler.OnBeforeUnloadDialog
        }
Ejemplo n.º 16
0
 public unsafe extern int OnBeforeUnloadDialog(cef_browser_t *browser, [Immutable] cef_string_t *message_text, int is_reload, cef_jsdialog_callback_t *callback);
Ejemplo n.º 17
0
 public unsafe extern int OnJSDialog(cef_browser_t *browser, [Immutable] cef_string_t *origin_url, CefJSDialogType dialog_type, [Immutable] cef_string_t *message_text, [Immutable] cef_string_t *default_prompt_text, cef_jsdialog_callback_t *callback, int *suppress_message);
Ejemplo n.º 18
0
 public CefJSDialogCallback(cef_jsdialog_callback_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
Ejemplo n.º 19
0
 private CefJSDialogCallback(cef_jsdialog_callback_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }