diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-09-02 15:03:16 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2014-11-06 16:39:00 +0100 |
commit | fca9015175950b04bafb9b3af7d4e693eb0243d9 (patch) | |
tree | 3eaad9f6eb131d901da6aa32df15b984baff731c /src/core/browser_context_qt.cpp | |
parent | a5a680f93ddd2488c8eb494a17ff18a0932e8cec (diff) |
Unglobalize browserContext
This patch makes it possible to have more than one BrowserContext,
for instance for off-the-record browsering but also to enable any
other configuration on browser context level.
This will make it possible to add page-groups settings and API for
settingsthat can only be done on BrowserContext level.
This patch does not expose any new API.
Change-Id: I0a0e194449cfb5a096a4ac6e2f2b3882b6b4cfa2
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core/browser_context_qt.cpp')
-rw-r--r-- | src/core/browser_context_qt.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp index 3913b7548..4c17171d4 100644 --- a/src/core/browser_context_qt.cpp +++ b/src/core/browser_context_qt.cpp @@ -36,6 +36,7 @@ #include "browser_context_qt.h" +#include "browser_context_adapter.h" #include "type_conversion.h" #include "qtwebenginecoreglobal.h" #include "resource_context_qt.h" @@ -47,14 +48,8 @@ #include "content/public/browser/storage_partition.h" #include "net/proxy/proxy_config_service.h" -#include <QByteArray> -#include <QCoreApplication> -#include <QDir> -#include <QStandardPaths> -#include <QString> -#include <QStringBuilder> - -BrowserContextQt::BrowserContextQt() +BrowserContextQt::BrowserContextQt(BrowserContextAdapter *adapter) + : m_adapter(adapter) { resourceContext.reset(new ResourceContextQt(this)); } @@ -67,17 +62,12 @@ BrowserContextQt::~BrowserContextQt() base::FilePath BrowserContextQt::GetPath() const { - QString dataLocation = QStandardPaths::writableLocation(QStandardPaths::DataLocation); - if (dataLocation.isEmpty()) - dataLocation = QDir::homePath() % QDir::separator() % QChar::fromLatin1('.') % QCoreApplication::applicationName(); - - dataLocation.append(QDir::separator() % QLatin1String("QtWebEngine")); - return base::FilePath(toFilePathString(dataLocation)); + return base::FilePath(toFilePathString(m_adapter->path())); } bool BrowserContextQt::IsOffTheRecord() const { - return false; + return m_adapter->isOffTheRecord(); } net::URLRequestContextGetter *BrowserContextQt::GetRequestContext() |