private cef_drag_handler_t* get_drag_handler(cef_client_t* self)
        {
            CheckSelf(self);

            var result = GetDragHandler();
            return result != null ? result.ToNative() : null;
        }
        private int on_before_popup(cef_life_span_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_string_t* target_url, cef_string_t* target_frame_name, cef_popup_features_t* popupFeatures, cef_window_info_t* windowInfo, cef_client_t** client, cef_browser_settings_t* settings, int* no_javascript_access)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_frame = CefFrame.FromNative(frame);
            var m_targetUrl = cef_string_t.ToString(target_url);
            var m_targetFrameName = cef_string_t.ToString(target_frame_name);
            var m_popupFeatures = new CefPopupFeatures(popupFeatures);
            var m_windowInfo = CefWindowInfo.FromNative(windowInfo);
            var m_client = CefClient.FromNative(*client);
            var m_settings = new CefBrowserSettings(settings);
            var m_noJavascriptAccess = (*no_javascript_access) != 0;

            var o_client = m_client;
            var result = OnBeforePopup(m_browser, m_frame, m_targetUrl, m_targetFrameName, m_popupFeatures, m_windowInfo, ref m_client, m_settings, ref m_noJavascriptAccess);

            if ((object)o_client != m_client && m_client != null)
            {
                *client = m_client.ToNative();
            }

            *no_javascript_access = m_noJavascriptAccess ? 1 : 0;

            m_popupFeatures.Dispose();
            m_windowInfo.Dispose();
            m_settings.Dispose();

            return result ? 1 : 0;
        }
Example #3
0
        internal static cef_client_t *Alloc()
        {
            var ptr = (cef_client_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_client_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
Example #4
0
 internal static CefClient FromNativeOrNull(cef_client_t* ptr)
 {
     CefClient value = null;
     bool found;
     lock (_roots)
     {
         found = _roots.TryGetValue((IntPtr)ptr, out value);
     }
     return found ? value : null;
 }
        private cef_jsdialog_handler_t* get_jsdialog_handler(cef_client_t* self)
        {
            CheckSelf(self);

            var result = GetJSDialogHandler();
            return result != null ? result.ToNative() : null;
        }
        private cef_geolocation_handler_t* get_geolocation_handler(cef_client_t* self)
        {
            CheckSelf(self);

            var result = GetGeolocationHandler();
            return result != null ? result.ToNative() : null;
        }
 private cef_context_menu_handler_t* get_context_menu_handler(cef_client_t* self)
 {
     CheckSelf(self);
     var result = GetContextMenuHandler();
     return result != null ? result.ToNative() : null;
 }
 public static extern int create_browser(cef_window_info_t* windowInfo, cef_client_t* client, cef_string_t* url, cef_browser_settings_t* settings);
        private cef_request_handler_t* get_request_handler(cef_client_t* self)
        {
            CheckSelf(self);

            var result = GetRequestHandler();
            return result != null ? result.ToNative() : null;
        }
 public static extern cef_browser_t* create_browser_sync(cef_window_info_t* windowInfo, cef_client_t* client, cef_string_t* url, cef_browser_settings_t* settings, cef_request_context_t* request_context);
Example #11
0
 private int release(cef_client_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
Example #12
0
 private int get_refct(cef_client_t* self)
 {
     return _refct;
 }
Example #13
0
 private void CheckSelf(cef_client_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Example #14
0
 private int add_ref(cef_client_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
         return result;
     }
 }
Example #15
0
 internal static CefClient FromNative(cef_client_t* ptr)
 {
     var value = FromNativeOrNull(ptr);
     if (value == null) throw ExceptionBuilder.ObjectNotFound();
     return value;
 }
        private cef_keyboard_handler_t* get_keyboard_handler(cef_client_t* self)
        {
            CheckSelf(self);

            var result = GetKeyboardHandler();
            return result != null ? result.ToNative() : null;
        }
        private cef_life_span_handler_t* get_life_span_handler(cef_client_t* self)
        {
            CheckSelf(self);

            var result = GetLifeSpanHandler();
            return result != null ? result.ToNative() : null;
        }
 public static void show_dev_tools(cef_browser_host_t* self, cef_window_info_t* windowInfo, cef_client_t* client, cef_browser_settings_t* settings, cef_point_t* inspect_element_at)
 {
     show_dev_tools_delegate d;
     var p = self->_show_dev_tools;
     if (p == _p12) { d = _d12; }
     else
     {
         d = (show_dev_tools_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(show_dev_tools_delegate));
         if (_p12 == IntPtr.Zero) { _d12 = d; _p12 = p; }
     }
     d(self, windowInfo, client, settings, inspect_element_at);
 }
        private int on_process_message_received(cef_client_t* self, cef_browser_t* browser, CefProcessId source_process, cef_process_message_t* message)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_message = CefProcessMessage.FromNative(message);

            var result = OnProcessMessageReceived(m_browser, source_process, m_message);

            m_browser.Dispose();
            m_message.Dispose();

            return result ? 1 : 0;
        }
Example #20
0
 internal static cef_client_t* Alloc()
 {
     var ptr = (cef_client_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_client_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
Example #21
0
 internal static void Free(cef_client_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Example #22
0
 private int has_one_ref(cef_client_t* self)
 {
     lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
 }