diff options
Diffstat (limited to 'src/core/browser_context_qt.h')
-rw-r--r-- | src/core/browser_context_qt.h | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/src/core/browser_context_qt.h b/src/core/browser_context_qt.h index e2156f147..ca65552be 100644 --- a/src/core/browser_context_qt.h +++ b/src/core/browser_context_qt.h @@ -40,20 +40,18 @@ #ifndef BROWSER_CONTEXT_QT_H #define BROWSER_CONTEXT_QT_H -#include "content/public/browser/browser_context.h" +#include "chrome/browser/profiles/profile.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/resource_context.h" #include "net/url_request/url_request_context.h" #include <QtCore/qcompilerdetection.h> // Needed for Q_DECL_OVERRIDE -#if defined(ENABLE_SPELLCHECK) QT_BEGIN_NAMESPACE class QStringList; QT_END_NAMESPACE class TestingPrefStore; class PrefService; -#endif namespace QtWebEngineCore { @@ -62,39 +60,50 @@ class PermissionManagerQt; class SSLHostStateDelegateQt; class URLRequestContextGetterQt; -class BrowserContextQt : public content::BrowserContext +class BrowserContextQt : public Profile { public: explicit BrowserContextQt(BrowserContextAdapter *); virtual ~BrowserContextQt(); + // BrowserContext implementation: virtual base::FilePath GetPath() const Q_DECL_OVERRIDE; base::FilePath GetCachePath() const; virtual bool IsOffTheRecord() const Q_DECL_OVERRIDE; - virtual net::URLRequestContextGetter *GetRequestContext() Q_DECL_OVERRIDE; - virtual net::URLRequestContextGetter *GetRequestContextForRenderProcess(int) Q_DECL_OVERRIDE; - virtual net::URLRequestContextGetter *GetMediaRequestContext() Q_DECL_OVERRIDE; - virtual net::URLRequestContextGetter *GetMediaRequestContextForRenderProcess(int) Q_DECL_OVERRIDE; - virtual net::URLRequestContextGetter *GetMediaRequestContextForStoragePartition(const base::FilePath&, bool) Q_DECL_OVERRIDE; + net::URLRequestContextGetter *GetRequestContext(); + + virtual net::URLRequestContextGetter *CreateMediaRequestContext() Q_DECL_OVERRIDE; + virtual net::URLRequestContextGetter *CreateMediaRequestContextForStoragePartition(const base::FilePath& partition_path, bool in_memory) Q_DECL_OVERRIDE; + virtual content::ResourceContext *GetResourceContext() Q_DECL_OVERRIDE; virtual content::DownloadManagerDelegate *GetDownloadManagerDelegate() Q_DECL_OVERRIDE; virtual content::BrowserPluginGuestManager* GetGuestManager() Q_DECL_OVERRIDE; virtual storage::SpecialStoragePolicy *GetSpecialStoragePolicy() Q_DECL_OVERRIDE; virtual content::PushMessagingService* GetPushMessagingService() Q_DECL_OVERRIDE; virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() Q_DECL_OVERRIDE; - net::URLRequestContextGetter *CreateRequestContext(content::ProtocolHandlerMap *protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors); - virtual scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(const base::FilePath& partition_path) Q_DECL_OVERRIDE; + net::URLRequestContextGetter *CreateRequestContext( + content::ProtocolHandlerMap *protocol_handlers, + content::URLRequestInterceptorScopedVector request_interceptors) Q_DECL_OVERRIDE; + net::URLRequestContextGetter* CreateRequestContextForStoragePartition( + const base::FilePath& partition_path, bool in_memory, + content::ProtocolHandlerMap* protocol_handlers, + content::URLRequestInterceptorScopedVector request_interceptors) Q_DECL_OVERRIDE; + virtual std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(const base::FilePath& partition_path) Q_DECL_OVERRIDE; virtual content::PermissionManager *GetPermissionManager() Q_DECL_OVERRIDE; virtual content::BackgroundSyncController* GetBackgroundSyncController() Q_DECL_OVERRIDE; + // Profile implementation: + PrefService* GetPrefs() override; + const PrefService* GetPrefs() const override; + BrowserContextAdapter *adapter() { return m_adapter; } #if defined(ENABLE_SPELLCHECK) void failedToLoadDictionary(const std::string& language) override; - void setSpellCheckLanguage(const QString &language); - QString spellCheckLanguage() const; + void setSpellCheckLanguages(const QStringList &languages); + QStringList spellCheckLanguages() const; void setSpellCheckEnabled(bool enabled); bool isSpellCheckEnabled() const; #endif @@ -102,15 +111,13 @@ public: private: friend class ContentBrowserClientQt; friend class WebContentsAdapter; - scoped_ptr<content::ResourceContext> resourceContext; + std::unique_ptr<content::ResourceContext> resourceContext; scoped_refptr<URLRequestContextGetterQt> url_request_getter_; - scoped_ptr<PermissionManagerQt> permissionManager; - scoped_ptr<SSLHostStateDelegateQt> sslHostStateDelegate; + std::unique_ptr<PermissionManagerQt> permissionManager; + std::unique_ptr<SSLHostStateDelegateQt> sslHostStateDelegate; BrowserContextAdapter *m_adapter; -#if defined(ENABLE_SPELLCHECK) scoped_refptr<TestingPrefStore> m_prefStore; - scoped_ptr<PrefService> m_prefService; -#endif + std::unique_ptr<PrefService> m_prefService; friend class BrowserContextAdapter; DISALLOW_COPY_AND_ASSIGN(BrowserContextQt); |