Support configuration of preferences during runtime (issue #1709)

- Preferences are now associated with a CefRequestContext instead of
  being stored globally.
- Add methods to CefRequestContext for getting/setting preferences.
This commit is contained in:
Marshall Greenblatt
2015-10-02 19:03:16 -04:00
parent 2328b9be39
commit 5780ea8baa
33 changed files with 1760 additions and 35 deletions

View File

@@ -61,6 +61,14 @@ class CefRequestContextImpl : public CefRequestContext {
CefRefPtr<CefSchemeHandlerFactory> factory) override;
bool ClearSchemeHandlerFactories() override;
void PurgePluginListCache(bool reload_pages) override;
bool HasPreference(const CefString& name) override;
CefRefPtr<CefValue> GetPreference(const CefString& name) override;
CefRefPtr<CefDictionaryValue> GetAllPreferences(
bool include_defaults) override;
bool CanSetPreference(const CefString& name) override;
bool SetPreference(const CefString& name,
CefRefPtr<CefValue> value,
CefString& error) override;
const CefRequestContextSettings& settings() const { return settings_; }
@@ -74,6 +82,9 @@ class CefRequestContextImpl : public CefRequestContext {
CefRequestContextImpl(CefRefPtr<CefRequestContextImpl> other,
CefRefPtr<CefRequestContextHandler> handler);
// Make sure the browser context exists. Only called on the UI thread.
void EnsureBrowserContext();
void GetBrowserContextOnUIThread(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const BrowserContextCallback& callback);