/// <summary> /// Create a new browser window using the window parameters specified by /// |windowInfo|. If |requestContext| is NULL the global request context will be /// used. This function can only be called on the browser process UI thread. /// </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 CfxBrowser CreateBrowserSync(CfxWindowInfo windowInfo, CfxClient client, string url, CfxBrowserSettings settings, CfxRequestContext requestContext) { var url_pinned = new PinnedString(url); var __retval = CfxApi.cfx_browser_host_create_browser_sync(CfxWindowInfo.Unwrap(windowInfo), CfxClient.Unwrap(client), url_pinned.Obj.PinnedPtr, url_pinned.Length, CfxBrowserSettings.Unwrap(settings), CfxRequestContext.Unwrap(requestContext)); url_pinned.Obj.Free(); return(CfxBrowser.Wrap(__retval)); }
internal static CfxBrowser Wrap(IntPtr nativePtr) { if (nativePtr == IntPtr.Zero) { return(null); } lock (weakCache) { var wrapper = (CfxBrowser)weakCache.Get(nativePtr); if (wrapper == null) { wrapper = new CfxBrowser(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return(wrapper); } }
/// <summary> /// Returns true (1) if this object is pointing to the same handle as |that| /// object. /// </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 bool IsSame(CfxBrowser that) { return(0 != CfxApi.Browser.cfx_browser_is_same(NativePtr, CfxBrowser.Unwrap(that))); }