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;
        }
        private void on_context_menu_dismissed(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);

            OnContextMenuDismissed(mBrowser, mFrame);
        }
        private void on_load_start(cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_frame = CefFrame.FromNative(frame);

            OnLoadStart(m_browser, m_frame);
        }
        private void on_load_end(cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_frame = CefFrame.FromNative(frame);

            OnLoadEnd(m_browser, m_frame, httpStatusCode);
        }
        private void on_address_change(cef_display_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_string_t* url)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);
            var mUrl = cef_string_t.ToString(url);

            OnAddressChange(mBrowser, mFrame, mUrl);
        }
        private void on_load_error(cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, CefErrorCode errorCode, cef_string_t* errorText, cef_string_t* failedUrl)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_frame = CefFrame.FromNative(frame);
            var m_errorText = cef_string_t.ToString(errorText);
            var m_failedUrl = cef_string_t.ToString(failedUrl);

            OnLoadError(m_browser, m_frame, errorCode, m_errorText, m_failedUrl);
        }
        private int on_before_browse(cef_request_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request, int is_redirect)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_frame = CefFrame.FromNative(frame);
            var m_request = CefRequest.FromNative(request);
            var m_isRedirect = is_redirect != 0;

            var result = OnBeforeBrowse(m_browser, m_frame, m_request, m_isRedirect);

            return result ? 1 : 0;
        }
        private int on_context_menu_command(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* @params, int command_id, CefEventFlags event_flags)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);
            var mState = CefContextMenuParams.FromNative(@params);

            var result = OnContextMenuCommand(mBrowser, mFrame, mState, command_id, event_flags);

            mState.Dispose();

            return result ? 1 : 0;
        }
        private cef_resource_handler_t* get_resource_handler(cef_request_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_frame = CefFrame.FromNative(frame);
            var m_request = CefRequest.FromNative(request);

            var handler = GetResourceHandler(m_browser, m_frame, m_request);

            m_request.Dispose();

            return handler != null ? handler.ToNative() : null;
        }
        private cef_resource_handler_t* create(cef_scheme_handler_factory_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_string_t* scheme_name, cef_request_t* request)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNativeOrNull(browser);
            var m_frame = CefFrame.FromNativeOrNull(frame);
            var m_schemeName = cef_string_t.ToString(scheme_name);
            var m_request = CefRequest.FromNative(request);

            var handler = Create(m_browser, m_frame, m_schemeName, m_request);

            // TODO: [ApiUsage] method can return null, only when schemeName is built-in scheme, in other cases it is incorrect.
            return handler != null ? handler.ToNative() : null;
        }
        private int on_before_resource_load(cef_request_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_frame = CefFrame.FromNative(frame);
            var m_request = CefRequest.FromNative(request);

            var result = OnBeforeResourceLoad(m_browser, m_frame, m_request);

            m_request.Dispose();

            return result ? 1 : 0;
        }
        private void on_before_context_menu(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* @params, cef_menu_model_t* model)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);
            var mState = CefContextMenuParams.FromNative(@params);
            var mModel = CefMenuModel.FromNative(model);

            OnBeforeContextMenu(mBrowser, mFrame, mState, mModel);

            mState.Dispose();
            mModel.Dispose();
        }
Esempio n. 13
0
 public static void load_url(cef_frame_t* self, cef_string_t* url)
 {
     load_url_delegate d;
     var p = self->_load_url;
     if (p == _pf) { d = _df; }
     else
     {
         d = (load_url_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(load_url_delegate));
         if (_pf == IntPtr.Zero) { _df = d; _pf = p; }
     }
     d(self, url);
 }
Esempio n. 14
0
 public static void visit_dom(cef_frame_t* self, cef_domvisitor_t* visitor)
 {
     visit_dom_delegate d;
     var p = self->_visit_dom;
     if (p == _p1a) { d = _d1a; }
     else
     {
         d = (visit_dom_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(visit_dom_delegate));
         if (_p1a == IntPtr.Zero) { _d1a = d; _p1a = p; }
     }
     try
     {
         d(self, visitor);
     }
     catch
     {
     }
 }
Esempio n. 15
0
 public static cef_v8context_t* get_v8context(cef_frame_t* self)
 {
     get_v8context_delegate d;
     var p = self->_get_v8context;
     if (p == _p19) { d = _d19; }
     else
     {
         d = (get_v8context_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_v8context_delegate));
         if (_p19 == IntPtr.Zero) { _d19 = d; _p19 = p; }
     }
     return d(self);
 }
Esempio n. 16
0
 public static cef_browser_t* get_browser(cef_frame_t* self)
 {
     get_browser_delegate d;
     var p = self->_get_browser;
     if (p == _p18) { d = _d18; }
     else
     {
         d = (get_browser_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_browser_delegate));
         if (_p18 == IntPtr.Zero) { _d18 = d; _p18 = p; }
     }
     return d(self);
 }
Esempio n. 17
0
 public static cef_string_userfree* get_url(cef_frame_t* self)
 {
     get_url_delegate d;
     var p = self->_get_url;
     if (p == _p17) { d = _d17; }
     else
     {
         d = (get_url_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_url_delegate));
         if (_p17 == IntPtr.Zero) { _d17 = d; _p17 = p; }
     }
     return d(self);
 }
Esempio n. 18
0
 public static cef_frame_t* get_parent(cef_frame_t* self)
 {
     get_parent_delegate d;
     var p = self->_get_parent;
     if (p == _p16) { d = _d16; }
     else
     {
         d = (get_parent_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_parent_delegate));
         if (_p16 == IntPtr.Zero) { _d16 = d; _p16 = p; }
     }
     return d(self);
 }
Esempio n. 19
0
 public static long get_identifier(cef_frame_t* self)
 {
     get_identifier_delegate d;
     var p = self->_get_identifier;
     if (p == _p15) { d = _d15; }
     else
     {
         d = (get_identifier_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_identifier_delegate));
         if (_p15 == IntPtr.Zero) { _d15 = d; _p15 = p; }
     }
     return d(self);
 }
Esempio n. 20
0
 public static int is_focused(cef_frame_t* self)
 {
     is_focused_delegate d;
     var p = self->_is_focused;
     if (p == _p13) { d = _d13; }
     else
     {
         d = (is_focused_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_focused_delegate));
         if (_p13 == IntPtr.Zero) { _d13 = d; _p13 = p; }
     }
     return d(self);
 }
Esempio n. 21
0
 public static int is_main(cef_frame_t* self)
 {
     is_main_delegate d;
     var p = self->_is_main;
     if (p == _p12) { d = _d12; }
     else
     {
         d = (is_main_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_main_delegate));
         if (_p12 == IntPtr.Zero) { _d12 = d; _p12 = p; }
     }
     return d(self);
 }
Esempio n. 22
0
 internal static CefFrame FromNativeOrNull(cef_frame_t* ptr)
 {
     if (ptr == null) return null;
     return new CefFrame(ptr);
 }
Esempio n. 23
0
 public static void select_all(cef_frame_t* self)
 {
     select_all_delegate d;
     var p = self->_select_all;
     if (p == _pa) { d = _da; }
     else
     {
         d = (select_all_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(select_all_delegate));
         if (_pa == IntPtr.Zero) { _da = d; _pa = p; }
     }
     d(self);
 }
Esempio n. 24
0
 public static void load_request(cef_frame_t* self, cef_request_t* request)
 {
     load_request_delegate d;
     var p = self->_load_request;
     if (p == _pe) { d = _de; }
     else
     {
         d = (load_request_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(load_request_delegate));
         if (_pe == IntPtr.Zero) { _de = d; _pe = p; }
     }
     d(self, request);
 }
Esempio n. 25
0
 public static void get_text(cef_frame_t* self, cef_string_visitor_t* visitor)
 {
     get_text_delegate d;
     var p = self->_get_text;
     if (p == _pd) { d = _dd; }
     else
     {
         d = (get_text_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_text_delegate));
         if (_pd == IntPtr.Zero) { _dd = d; _pd = p; }
     }
     d(self, visitor);
 }
Esempio n. 26
0
 public static void view_source(cef_frame_t* self)
 {
     view_source_delegate d;
     var p = self->_view_source;
     if (p == _pb) { d = _db; }
     else
     {
         d = (view_source_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(view_source_delegate));
         if (_pb == IntPtr.Zero) { _db = d; _pb = p; }
     }
     d(self);
 }
Esempio n. 27
0
 internal static CefFrame FromNative(cef_frame_t* ptr)
 {
     return new CefFrame(ptr);
 }
Esempio n. 28
0
 public static void load_string(cef_frame_t* self, cef_string_t* string_val, cef_string_t* url)
 {
     load_string_delegate d;
     var p = self->_load_string;
     if (p == _p10) { d = _d10; }
     else
     {
         d = (load_string_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(load_string_delegate));
         if (_p10 == IntPtr.Zero) { _d10 = d; _p10 = p; }
     }
     d(self, string_val, url);
 }
Esempio n. 29
0
 private CefFrame(cef_frame_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
Esempio n. 30
0
 public static void execute_java_script(cef_frame_t* self, cef_string_t* code, cef_string_t* script_url, int start_line)
 {
     execute_java_script_delegate d;
     var p = self->_execute_java_script;
     if (p == _p11) { d = _d11; }
     else
     {
         d = (execute_java_script_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(execute_java_script_delegate));
         if (_p11 == IntPtr.Zero) { _d11 = d; _p11 = p; }
     }
     d(self, code, script_url, start_line);
 }