summaryrefslogtreecommitdiff
path: root/chromium/weblayer/browser/profile_impl.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/weblayer/browser/profile_impl.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/weblayer/browser/profile_impl.h')
-rw-r--r--chromium/weblayer/browser/profile_impl.h43
1 files changed, 36 insertions, 7 deletions
diff --git a/chromium/weblayer/browser/profile_impl.h b/chromium/weblayer/browser/profile_impl.h
index fbd30a82c8a..d845d6bc646 100644
--- a/chromium/weblayer/browser/profile_impl.h
+++ b/chromium/weblayer/browser/profile_impl.h
@@ -5,6 +5,8 @@
#ifndef WEBLAYER_BROWSER_PROFILE_IMPL_H_
#define WEBLAYER_BROWSER_PROFILE_IMPL_H_
+#include <set>
+
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
@@ -46,7 +48,22 @@ class ProfileImpl : public Profile {
static ProfileImpl* FromBrowserContext(
content::BrowserContext* browser_context);
- content::BrowserContext* GetBrowserContext();
+ static std::set<ProfileImpl*> GetAllProfiles();
+
+ // Allows getting notified when profiles are created or destroyed.
+ class ProfileObserver {
+ public:
+ virtual void ProfileCreated(ProfileImpl* profile) {}
+ virtual void ProfileDestroyed(ProfileImpl* profile) {}
+
+ protected:
+ virtual ~ProfileObserver() = default;
+ };
+
+ static void AddProfileObserver(ProfileObserver* observer);
+ static void RemoveProfileObserver(ProfileObserver* observer);
+
+ BrowserContextImpl* GetBrowserContext();
// Called when the download subsystem has finished initializing. By this point
// information about downloads that were interrupted by a previous crash would
@@ -55,6 +72,7 @@ class ProfileImpl : public Profile {
// Path data is stored at, empty if off-the-record.
const base::FilePath& data_path() const { return info_.data_path; }
+ const std::string& name() const { return info_.name; }
DownloadDelegate* download_delegate() { return download_delegate_; }
// Profile implementation:
@@ -65,8 +83,14 @@ class ProfileImpl : public Profile {
void SetDownloadDirectory(const base::FilePath& directory) override;
void SetDownloadDelegate(DownloadDelegate* delegate) override;
CookieManager* GetCookieManager() override;
+ void GetBrowserPersistenceIds(
+ base::OnceCallback<void(base::flat_set<std::string>)> callback) override;
+ void RemoveBrowserPersistenceStorage(
+ base::OnceCallback<void(bool)> done_callback,
+ base::flat_set<std::string> ids) override;
void SetBooleanSetting(SettingType type, bool value) override;
bool GetBooleanSetting(SettingType type) override;
+ void PrepareForPossibleCrossOriginNavigation() override;
#if defined(OS_ANDROID)
ProfileImpl(JNIEnv* env,
@@ -91,10 +115,16 @@ class ProfileImpl : public Profile {
void EnsureBrowserContextInitialized(JNIEnv* env);
void SetBooleanSetting(JNIEnv* env, jint j_type, jboolean j_value);
jboolean GetBooleanSetting(JNIEnv* env, jint j_type);
+ void GetBrowserPersistenceIds(
+ JNIEnv* env,
+ const base::android::JavaRef<jobject>& j_callback);
+ void RemoveBrowserPersistenceStorage(
+ JNIEnv* env,
+ const base::android::JavaRef<jobjectArray>& j_ids,
+ const base::android::JavaRef<jobject>& j_callback);
+ void PrepareForPossibleCrossOriginNavigation(JNIEnv* env);
#endif
- void IncrementBrowserImplCount();
- void DecrementBrowserImplCount();
const base::FilePath& download_directory() { return download_directory_; }
// Get the directory where BrowserPersister stores tab state data. This will
@@ -115,6 +145,9 @@ class ProfileImpl : public Profile {
// Callback when the system locale has been updated.
void OnLocaleChanged();
+ // Returns the number of Browsers with this profile.
+ int GetNumberOfBrowsers();
+
ProfileInfo info_;
std::unique_ptr<BrowserContextImpl> browser_context_;
@@ -127,10 +160,6 @@ class ProfileImpl : public Profile {
std::unique_ptr<CookieManagerImpl> cookie_manager_;
- size_t num_browser_impl_ = 0u;
-
- bool basic_safe_browsing_enabled_ = true;
-
#if defined(OS_ANDROID)
base::android::ScopedJavaGlobalRef<jobject> java_profile_;
#endif