diff options
Diffstat (limited to 'src')
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/configure/BUILD.root.gn.in | 1 | ||||
-rw-r--r-- | src/core/profile_qt.cpp | 11 | ||||
-rw-r--r-- | src/core/profile_qt.h | 1 |
4 files changed, 13 insertions, 0 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject 6559e00a366dac58b3467bd8475cc936baa1e5b +Subproject 88398c89a7b34606120ff919f873cb59ce3bcf2 diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in index a5a27e4f0..35fe32476 100644 --- a/src/core/configure/BUILD.root.gn.in +++ b/src/core/configure/BUILD.root.gn.in @@ -118,6 +118,7 @@ shared_library("QtWebEngineCore") { "//components/web_cache/browser", "//components/web_cache/renderer", "//components/spellcheck:buildflags", + "//components/profile_metrics", "//components/proxy_config", "//components/user_prefs", "//content/public/app", diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp index 829f96249..5bb54466c 100644 --- a/src/core/profile_qt.cpp +++ b/src/core/profile_qt.cpp @@ -69,6 +69,7 @@ #include "components/prefs/pref_service_factory.h" #include "components/prefs/pref_registry_simple.h" #include "components/user_prefs/user_prefs.h" +#include "components/profile_metrics/browser_profile_type.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "chrome/common/pref_names.h" #if QT_CONFIG(webengine_spellchecker) @@ -129,6 +130,11 @@ const PrefService* ProfileQt::GetPrefs() const return m_prefServiceAdapter.prefService(); } +bool ProfileQt::IsNewProfile() const +{ + return GetPrefs()->GetInitializationStatus() == PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE; +} + base::FilePath ProfileQt::GetPath() { return toFilePath(m_profileAdapter->dataPath()); @@ -248,6 +254,11 @@ content::FileSystemAccessPermissionContext *ProfileQt::GetFileSystemAccessPermis void ProfileQt::setupPrefService() { + profile_metrics::SetBrowserProfileType(this, + IsOffTheRecord() + ? profile_metrics::BrowserProfileType::kIncognito + : profile_metrics::BrowserProfileType::kRegular); + // Remove previous handler before we set a new one or we will assert // TODO: Remove in Qt6 if (m_prefServiceAdapter.prefService() != nullptr) { diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h index 9fb1e7f04..7c457c8ae 100644 --- a/src/core/profile_qt.h +++ b/src/core/profile_qt.h @@ -96,6 +96,7 @@ public: // Profile implementation: PrefService *GetPrefs() override; const PrefService *GetPrefs() const override; + bool IsNewProfile() const override; void Initialize(); ProfileAdapter *profileAdapter() { return m_profileAdapter; } |