diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-09-20 09:53:56 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-09-20 10:43:27 +0000 |
commit | 4b9599123f636b56065b87ba670a8ae586c85557 (patch) | |
tree | 105c5beb3e46f5374e4afc4eca2ebcf7bc49692c /src | |
parent | 37d03fb2dbeb1dcc4793bc735abb742ef481dd3e (diff) |
Make BrowserContextQt a Chrome Profile
Expose the preferences as a Profile class, this will make it possible
to use more Chromium code unmodified.
Change-Id: If49b5239c573391f8e25cfadc18240ed666974ae
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src')
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/browser_context_qt.cpp | 10 | ||||
-rw-r--r-- | src/core/browser_context_qt.h | 9 | ||||
-rw-r--r-- | src/core/chrome_qt.gyp | 2 |
4 files changed, 19 insertions, 2 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject 8158f645b0cfea734b5ff99777227380f615873 +Subproject b4c72f26c1b72ae2fedf601c3f5b6708bdff22d diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp index bc5341f46..5f544ab86 100644 --- a/src/core/browser_context_qt.cpp +++ b/src/core/browser_context_qt.cpp @@ -97,6 +97,16 @@ BrowserContextQt::~BrowserContextQt() content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, resourceContext.release()); } +PrefService* BrowserContextQt::GetPrefs() +{ + return m_prefService.get(); +} + +const PrefService* BrowserContextQt::GetPrefs() const +{ + return m_prefService.get(); +} + base::FilePath BrowserContextQt::GetPath() const { return toFilePath(m_adapter->dataPath()); diff --git a/src/core/browser_context_qt.h b/src/core/browser_context_qt.h index 57ee138b1..41a85b1b0 100644 --- a/src/core/browser_context_qt.h +++ b/src/core/browser_context_qt.h @@ -40,7 +40,7 @@ #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" @@ -60,13 +60,14 @@ 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; @@ -93,6 +94,10 @@ public: 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) diff --git a/src/core/chrome_qt.gyp b/src/core/chrome_qt.gyp index 68f161be4..547f240ea 100644 --- a/src/core/chrome_qt.gyp +++ b/src/core/chrome_qt.gyp @@ -74,6 +74,8 @@ '<(DEPTH)/chrome/browser/media/desktop_media_list.h', '<(DEPTH)/chrome/browser/media/desktop_streams_registry.cc', '<(DEPTH)/chrome/browser/media/desktop_streams_registry.h', + '<(DEPTH)/chrome/browser/profiles/profile.cc', + '<(DEPTH)/chrome/browser/profiles/profile.h', '<(DEPTH)/chrome/common/chrome_switches.cc', '<(DEPTH)/chrome/common/chrome_switches.h', '<(DEPTH)/components/prefs/testing_pref_store.cc', |