/// <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 cookie manager for this object. 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 GetCookieManager(CefCompletionCallback callback) { var n_callback = callback != null?callback.ToNative() : null; return(CefCookieManager.FromNativeOrNull( cef_request_context_t.get_cookie_manager(_self, n_callback) )); }
/// <summary> /// Set the schemes supported by this manager. By default only "http" and /// "https" schemes are supported. 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_handler = callback != null?callback.ToNative() : null; cef_cookie_manager_t.set_supported_schemes(_self, n_schemes, n_handler); libcef.string_list_free(n_schemes); }
/// <summary> /// Set the schemes supported by this manager. If |include_defaults| is true /// the default schemes ("http", "https", "ws" and "wss") will also be /// supported. Calling this method with an empty |schemes| value and /// |include_defaults| set to false will disable all loading and saving of /// cookies for this manager. If |callback| is non-NULL it will be executed /// asnychronously on the UI thread after the change has been applied. Must be /// called before any cookies are accessed. /// </summary> public void SetSupportedSchemes(string[] schemes, bool includeDefaults, 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, includeDefaults ? 1 : 0, n_callback); libcef.string_list_free(n_schemes); }
/// <summary> /// Start tracing events on all processes. Tracing is initialized asynchronously /// and |callback| will be executed on the UI thread after initialization is /// complete. /// /// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is /// pending, CefBeginTracing will fail and return false. /// /// |categories| is a comma-delimited list of category wildcards. A category can /// have an optional '-' prefix to make it an excluded category. Having both /// included and excluded categories in the same list is not supported. /// /// Example: "test_MyTest*" /// Example: "test_MyTest*,test_OtherStuff" /// Example: "-excluded_category1,-excluded_category2" /// /// This function must be called on the browser process UI thread. /// </summary> public static bool BeginTracing(string categories = null, CefCompletionCallback callback = null) { fixed(char *categories_str = categories) { var n_categories = new cef_string_t(categories_str, categories != null ? categories.Length : 0); var n_callback = callback != null?callback.ToNative() : null; return(libcef.begin_tracing(&n_categories, n_callback) != 0); } }
/// <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 HTTP authentication credentials that were added as part of /// handling GetAuthCredentials. If |callback| is non-NULL it will be executed /// on the UI thread after completion. /// </summary> public void ClearHttpAuthCredentials(CefCompletionCallback callback) { var n_callback = callback != null?callback.ToNative() : null; cef_request_context_t.clear_http_auth_credentials(_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); }
/// <summary> /// Flush the backing store (if any) to disk and execute the specified /// |callback| on the IO thread when done. Returns false if cookies cannot be /// accessed. /// </summary> public bool FlushStore(CefCompletionCallback callback) { var n_handler = callback != null ? callback.ToNative() : null; return cef_cookie_manager_t.flush_store(_self, n_handler) != 0; }