internal static void on_before_popup(IntPtr gcHandlePtr, out int __retval, IntPtr browser, out int browser_release, IntPtr frame, out int frame_release, IntPtr target_url_str, int target_url_length, IntPtr target_frame_name_str, int target_frame_name_length, int target_disposition, int user_gesture, IntPtr popupFeatures, IntPtr windowInfo, out IntPtr client, IntPtr settings, out int no_javascript_access) { var self = (CfxLifeSpanHandler)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target; if (self == null || self.CallbacksDisabled) { __retval = default(int); browser_release = 1; frame_release = 1; client = default(IntPtr); no_javascript_access = default(int); return; } var e = new CfxOnBeforePopupEventArgs(); e.m_browser = browser; e.m_frame = frame; e.m_target_url_str = target_url_str; e.m_target_url_length = target_url_length; e.m_target_frame_name_str = target_frame_name_str; e.m_target_frame_name_length = target_frame_name_length; e.m_target_disposition = target_disposition; e.m_user_gesture = user_gesture; e.m_popupFeatures = popupFeatures; e.m_windowInfo = windowInfo; e.m_settings = settings; self.m_OnBeforePopup?.Invoke(self, e); e.m_isInvalid = true; browser_release = e.m_browser_wrapped == null? 1 : 0; frame_release = e.m_frame_wrapped == null? 1 : 0; client = CfxClient.Unwrap(e.m_client_wrapped); no_javascript_access = e.m_no_javascript_access; __retval = e.m_returnValue ? 1 : 0; }
/// <summary> /// Create a new browser window using the window parameters specified by /// |windowInfo|. All values will be copied internally and the actual window will /// be created on the UI thread. If |requestContext| is NULL the global request /// context will be used. This function can be called on any browser process /// thread and will not block. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_browser_capi.h">cef/include/capi/cef_browser_capi.h</see>. /// </remarks> public static bool CreateBrowser(CfxWindowInfo windowInfo, CfxClient client, string url, CfxBrowserSettings settings, CfxRequestContext requestContext) { var url_pinned = new PinnedString(url); var __retval = CfxApi.cfx_browser_host_create_browser(CfxWindowInfo.Unwrap(windowInfo), CfxClient.Unwrap(client), url_pinned.Obj.PinnedPtr, url_pinned.Length, CfxBrowserSettings.Unwrap(settings), CfxRequestContext.Unwrap(requestContext)); url_pinned.Obj.Free(); return(0 != __retval); }
/// <summary> /// Open developer tools in its own window. If |inspectElementAt| is non- /// NULL the element at the specified (x,y) location will be inspected. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_browser_capi.h">cef/include/capi/cef_browser_capi.h</see>. /// </remarks> public void ShowDevTools(CfxWindowInfo windowInfo, CfxClient client, CfxBrowserSettings settings, CfxPoint inspectElementAt) { CfxApi.cfx_browser_host_show_dev_tools(NativePtr, CfxWindowInfo.Unwrap(windowInfo), CfxClient.Unwrap(client), CfxBrowserSettings.Unwrap(settings), CfxPoint.Unwrap(inspectElementAt)); }