/// <summary> /// Returns the global cookie manager. By default data will be stored at /// CefSettings.cache_path if specified or in memory otherwise. If |callback| /// is non-NULL it will be executed asnychronously on the IO thread after the /// manager's storage has been initialized. Using this method is equivalent to /// calling CefRequestContext::GetGlobalContext()->GetDefaultCookieManager(). /// </summary> public static CefCookieManager GetGlobal(CefCompletionCallback callback) { var n_callback = callback != null?callback.ToNative() : null; return(CefCookieManager.FromNativeOrNull( cef_cookie_manager_t.get_global_manager(n_callback) )); }
/// <summary> /// Returns the default cookie manager for this object. This will be the global /// cookie manager if this object is the global request context. Otherwise, /// this will be the default cookie manager used when this request context does /// not receive a value via CefRequestContextHandler::GetCookieManager(). If /// |callback| is non-NULL it will be executed asnychronously on the IO thread /// after the manager's storage has been initialized. /// </summary> public CefCookieManager GetDefaultCookieManager(CefCompletionCallback callback) { var n_callback = callback != null?callback.ToNative() : null; return(CefCookieManager.FromNativeOrNull( cef_request_context_t.get_default_cookie_manager(_self, n_callback) )); }
/// <summary> /// Set the schemes supported by this manager. The default schemes ("http", /// "https", "ws" and "wss") will always be supported. If |callback| is non- /// NULL it will be executed asnychronously on the IO thread after the change /// has been applied. Must be called before any cookies are accessed. /// </summary> public void SetSupportedSchemes(string[] schemes, CefCompletionCallback callback) { var n_schemes = cef_string_list.From(schemes); var n_callback = callback != null?callback.ToNative() : null; cef_cookie_manager_t.set_supported_schemes(_self, n_schemes, n_callback); libcef.string_list_free(n_schemes); }
/// <summary> /// Creates a new cookie manager. If |path| is empty data will be stored in /// memory only. Otherwise, data will be stored at the specified |path|. To /// persist session cookies (cookies without an expiry date or validity /// interval) set |persist_session_cookies| to true. Session cookies are /// generally intended to be transient and most Web browsers do not persist /// them. If |callback| is non-NULL it will be executed asnychronously on the /// IO thread after the manager's storage has been initialized. /// </summary> public static CefCookieManager Create(string path, bool persistSessionCookies, CefCompletionCallback callback) { fixed(char *path_str = path) { var n_path = new cef_string_t(path_str, path != null ? path.Length : 0); var n_callback = callback != null?callback.ToNative() : null; return(CefCookieManager.FromNativeOrNull( cef_cookie_manager_t.create_manager(&n_path, persistSessionCookies ? 1 : 0, n_callback) )); } }
/// <summary> /// Clears all active and idle connections that Chromium currently has. /// This is only recommended if you have released all other CEF objects but /// don't yet want to call CefShutdown(). If |callback| is non-NULL it will be /// executed on the UI thread after completion. /// </summary> public void CloseAllConnections(CefCompletionCallback callback) { var n_callback = callback != null?callback.ToNative() : null; cef_request_context_t.close_all_connections(_self, n_callback); }
/// <summary> /// Clears all certificate exceptions that were added as part of handling /// CefRequestHandler::OnCertificateError(). If you call this it is /// recommended that you also call CloseAllConnections() or you risk not /// being prompted again for server certificates if you reconnect quickly. /// If |callback| is non-NULL it will be executed on the UI thread after /// completion. /// </summary> public void ClearCertificateExceptions(CefCompletionCallback callback) { var n_callback = callback != null?callback.ToNative() : null; cef_request_context_t.clear_certificate_exceptions(_self, n_callback); }