From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- chromium/weblayer/browser/profile_impl.h | 43 ++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'chromium/weblayer/browser/profile_impl.h') 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 + #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 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)> callback) override; + void RemoveBrowserPersistenceStorage( + base::OnceCallback done_callback, + base::flat_set 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& j_callback); + void RemoveBrowserPersistenceStorage( + JNIEnv* env, + const base::android::JavaRef& j_ids, + const base::android::JavaRef& 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 browser_context_; @@ -127,10 +160,6 @@ class ProfileImpl : public Profile { std::unique_ptr cookie_manager_; - size_t num_browser_impl_ = 0u; - - bool basic_safe_browsing_enabled_ = true; - #if defined(OS_ANDROID) base::android::ScopedJavaGlobalRef java_profile_; #endif -- cgit v1.2.1