2021-04-09 20:34:45 +02:00
|
|
|
diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc
|
2023-08-09 23:17:17 +02:00
|
|
|
index 48e30b2833a05..2d848247b9bce 100644
|
2021-04-09 20:34:45 +02:00
|
|
|
--- chrome/browser/profiles/off_the_record_profile_impl.cc
|
|
|
|
+++ chrome/browser/profiles/off_the_record_profile_impl.cc
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -652,7 +652,9 @@ std::unique_ptr<Profile> Profile::CreateOffTheRecordProfile(
|
2021-04-09 20:34:45 +02:00
|
|
|
#endif
|
|
|
|
if (!profile)
|
2021-04-21 00:52:34 +02:00
|
|
|
profile = std::make_unique<OffTheRecordProfileImpl>(parent, otr_profile_id);
|
2021-04-09 20:34:45 +02:00
|
|
|
- profile->Init();
|
|
|
|
+ // With CEF we want to delay initialization.
|
|
|
|
+ if (!otr_profile_id.IsUniqueForCEF())
|
|
|
|
+ profile->Init();
|
|
|
|
return std::move(profile);
|
|
|
|
}
|
|
|
|
|
2021-04-07 00:09:45 +02:00
|
|
|
diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc
|
2023-04-26 21:55:59 +02:00
|
|
|
index 6cffe941b26f9..3e6223ab0d423 100644
|
2021-04-07 00:09:45 +02:00
|
|
|
--- chrome/browser/profiles/profile.cc
|
|
|
|
+++ chrome/browser/profiles/profile.cc
|
2023-01-03 00:34:43 +01:00
|
|
|
@@ -84,6 +84,7 @@ base::LazyInstance<std::set<content::BrowserContext*>>::Leaky
|
2021-04-07 00:09:45 +02:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
+const char kCEFOTRProfileIDPrefix[] = "CEF::BrowserContext";
|
|
|
|
const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext";
|
|
|
|
const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation";
|
2021-06-04 03:34:56 +02:00
|
|
|
const char kTestOTRProfileIDPrefix[] = "Test::OTR";
|
2023-01-03 00:34:43 +01:00
|
|
|
@@ -104,6 +105,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const {
|
2022-10-17 19:27:40 +02:00
|
|
|
// DevTools::BrowserContext, MediaRouter::Presentation, and
|
|
|
|
// CaptivePortal::Signin are exceptions to this ban.
|
|
|
|
if (*this == PrimaryID() ||
|
|
|
|
+ base::StartsWith(profile_id_, kCEFOTRProfileIDPrefix,
|
|
|
|
+ base::CompareCase::SENSITIVE) ||
|
|
|
|
base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix,
|
|
|
|
base::CompareCase::SENSITIVE) ||
|
|
|
|
base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix,
|
2023-01-03 00:34:43 +01:00
|
|
|
@@ -141,6 +144,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique(
|
2023-04-26 21:55:59 +02:00
|
|
|
base::Uuid::GenerateRandomV4().AsLowercaseString().c_str()));
|
2021-04-07 00:09:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+// static
|
|
|
|
+Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForCEF() {
|
|
|
|
+ return CreateUnique(kCEFOTRProfileIDPrefix);
|
|
|
|
+}
|
2021-04-09 20:34:45 +02:00
|
|
|
+
|
|
|
|
+bool Profile::OTRProfileID::IsUniqueForCEF() const {
|
|
|
|
+ return base::StartsWith(profile_id_, kCEFOTRProfileIDPrefix,
|
|
|
|
+ base::CompareCase::SENSITIVE);
|
|
|
|
+}
|
2021-04-07 00:09:45 +02:00
|
|
|
+
|
|
|
|
// static
|
|
|
|
Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() {
|
|
|
|
return CreateUnique(kDevToolsOTRProfileIDPrefix);
|
|
|
|
diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h
|
2023-06-26 12:13:38 +02:00
|
|
|
index 946b9cb533714..80815f7feb8f8 100644
|
2021-04-07 00:09:45 +02:00
|
|
|
--- chrome/browser/profiles/profile.h
|
|
|
|
+++ chrome/browser/profiles/profile.h
|
2023-06-26 12:13:38 +02:00
|
|
|
@@ -104,6 +104,10 @@ class Profile : public content::BrowserContext {
|
2021-06-04 03:34:56 +02:00
|
|
|
// be applicable to run. Please see crbug.com/1098697#c3 for more details.
|
2021-04-07 00:09:45 +02:00
|
|
|
static OTRProfileID CreateUnique(const std::string& profile_id_prefix);
|
|
|
|
|
|
|
|
+ // Creates a unique OTR profile id to be used for CEF browser contexts.
|
|
|
|
+ static OTRProfileID CreateUniqueForCEF();
|
2021-04-09 20:34:45 +02:00
|
|
|
+ bool IsUniqueForCEF() const;
|
2021-04-07 00:09:45 +02:00
|
|
|
+
|
|
|
|
// Creates a unique OTR profile id to be used for DevTools browser contexts.
|
|
|
|
static OTRProfileID CreateUniqueForDevTools();
|
|
|
|
|
2023-06-26 12:13:38 +02:00
|
|
|
@@ -529,6 +533,8 @@ class Profile : public content::BrowserContext {
|
|
|
|
return instant_service_;
|
|
|
|
}
|
2021-04-09 20:34:45 +02:00
|
|
|
|
|
|
|
+ void NotifyOffTheRecordProfileCreated(Profile* off_the_record);
|
|
|
|
+
|
|
|
|
protected:
|
2021-06-04 03:34:56 +02:00
|
|
|
// Creates an OffTheRecordProfile which points to this Profile.
|
|
|
|
static std::unique_ptr<Profile> CreateOffTheRecordProfile(
|
2023-06-26 12:13:38 +02:00
|
|
|
@@ -540,7 +546,6 @@ class Profile : public content::BrowserContext {
|
2021-04-09 20:34:45 +02:00
|
|
|
static PrefStore* CreateExtensionPrefStore(Profile*,
|
|
|
|
bool incognito_pref_store);
|
|
|
|
|
|
|
|
- void NotifyOffTheRecordProfileCreated(Profile* off_the_record);
|
2023-01-30 18:43:54 +01:00
|
|
|
void NotifyProfileInitializationComplete();
|
2021-04-09 20:34:45 +02:00
|
|
|
|
2023-01-30 18:43:54 +01:00
|
|
|
// Returns whether the user has signed in this profile to an account.
|
2021-04-09 20:34:45 +02:00
|
|
|
diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc
|
2023-08-09 23:17:17 +02:00
|
|
|
index f3e41082fe306..abdefa172be33 100644
|
2021-04-09 20:34:45 +02:00
|
|
|
--- chrome/browser/profiles/profile_impl.cc
|
|
|
|
+++ chrome/browser/profiles/profile_impl.cc
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -1023,7 +1023,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
|
2021-04-09 20:34:45 +02:00
|
|
|
|
|
|
|
otr_profiles_[otr_profile_id] = std::move(otr_profile);
|
|
|
|
|
|
|
|
- NotifyOffTheRecordProfileCreated(raw_otr_profile);
|
|
|
|
+ // With CEF we want to delay initialization.
|
|
|
|
+ if (!otr_profile_id.IsUniqueForCEF())
|
|
|
|
+ NotifyOffTheRecordProfileCreated(raw_otr_profile);
|
|
|
|
|
|
|
|
return raw_otr_profile;
|
|
|
|
}
|
2017-07-27 01:19:27 +02:00
|
|
|
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
|
2023-08-09 23:17:17 +02:00
|
|
|
index ad64bc75b7383..f8eb816d6f2cf 100644
|
2017-07-27 01:19:27 +02:00
|
|
|
--- chrome/browser/profiles/profile_manager.cc
|
|
|
|
+++ chrome/browser/profiles/profile_manager.cc
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -394,7 +394,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
|
|
|
|
profile_manager_android_ = std::make_unique<ProfileManagerAndroid>(this);
|
2021-04-21 00:52:34 +02:00
|
|
|
#endif
|
2017-09-06 23:40:58 +02:00
|
|
|
|
2017-07-27 01:19:27 +02:00
|
|
|
- if (ProfileShortcutManager::IsFeatureEnabled() && !user_data_dir_.empty())
|
|
|
|
+ if (!user_data_dir_.empty() && ProfileShortcutManager::IsFeatureEnabled())
|
2019-02-01 17:42:40 +01:00
|
|
|
profile_shortcut_manager_ = ProfileShortcutManager::Create(this);
|
|
|
|
|
2022-01-25 21:26:51 +01:00
|
|
|
zombie_metrics_timer_.Start(FROM_HERE, base::Minutes(30), this,
|
2016-07-18 23:22:22 +02:00
|
|
|
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
|
2023-08-09 23:17:17 +02:00
|
|
|
index 5f471502c07a8..6a28e9452a359 100644
|
2016-07-18 23:22:22 +02:00
|
|
|
--- chrome/browser/profiles/profile_manager.h
|
|
|
|
+++ chrome/browser/profiles/profile_manager.h
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -134,7 +134,7 @@ class ProfileManager : public Profile::Delegate {
|
2023-01-03 00:34:43 +01:00
|
|
|
// acceptable. Returns nullptr if loading the new profile fails.
|
|
|
|
// TODO(bauerb): Migrate calls from other code to `GetProfileByPath()`, then
|
2016-08-04 14:37:53 +02:00
|
|
|
// make this method private.
|
|
|
|
- Profile* GetProfile(const base::FilePath& profile_dir);
|
|
|
|
+ virtual Profile* GetProfile(const base::FilePath& profile_dir);
|
|
|
|
|
2020-08-29 00:39:23 +02:00
|
|
|
// Returns regular or off-the-record profile given its profile key.
|
|
|
|
static Profile* GetProfileFromProfileKey(ProfileKey* profile_key);
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -178,7 +178,7 @@ class ProfileManager : public Profile::Delegate {
|
2016-07-18 23:22:22 +02:00
|
|
|
|
|
|
|
// Returns true if the profile pointer is known to point to an existing
|
|
|
|
// profile.
|
|
|
|
- bool IsValidProfile(const void* profile);
|
|
|
|
+ virtual bool IsValidProfile(const void* profile);
|
|
|
|
|
|
|
|
// Returns the directory where the first created profile is stored,
|
|
|
|
// relative to the user data directory currently in use.
|
2019-09-25 15:59:51 +02:00
|
|
|
diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc
|
2023-05-30 10:55:32 +02:00
|
|
|
index 884e79cd54e0d..4e840df66756d 100644
|
2019-09-25 15:59:51 +02:00
|
|
|
--- chrome/browser/profiles/renderer_updater.cc
|
|
|
|
+++ chrome/browser/profiles/renderer_updater.cc
|
2023-04-26 21:55:59 +02:00
|
|
|
@@ -9,6 +9,7 @@
|
2023-01-30 18:43:54 +01:00
|
|
|
#include "base/functional/bind.h"
|
2023-04-26 21:55:59 +02:00
|
|
|
#include "base/functional/callback.h"
|
2021-01-28 00:13:12 +01:00
|
|
|
#include "build/chromeos_buildflags.h"
|
2020-07-04 04:51:17 +02:00
|
|
|
+#include "cef/libcef/features/runtime.h"
|
2021-08-20 01:40:49 +02:00
|
|
|
#include "chrome/browser/content_settings/content_settings_manager_delegate.h"
|
2019-09-25 15:59:51 +02:00
|
|
|
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
|
|
|
#include "chrome/browser/profiles/profile.h"
|
2023-05-30 10:55:32 +02:00
|
|
|
@@ -46,11 +47,14 @@ RendererUpdater::RendererUpdater(Profile* profile)
|
|
|
|
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
|
|
|
|
,
|
|
|
|
bound_session_cookie_refresh_service_(
|
|
|
|
+ cef::IsAlloyRuntimeEnabled() ? nullptr :
|
2023-04-26 21:55:59 +02:00
|
|
|
BoundSessionCookieRefreshServiceFactory::GetForProfile(profile))
|
|
|
|
#endif
|
|
|
|
{
|
2022-03-26 02:12:30 +01:00
|
|
|
+ if (!cef::IsAlloyRuntimeEnabled()) {
|
|
|
|
identity_manager_observation_.Observe(
|
|
|
|
IdentityManagerFactory::GetForProfile(original_profile_));
|
2020-07-04 04:51:17 +02:00
|
|
|
+ }
|
2022-03-26 02:12:30 +01:00
|
|
|
|
2021-01-28 00:13:12 +01:00
|
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
2019-09-25 15:59:51 +02:00
|
|
|
oauth2_login_manager_ =
|
2023-05-30 10:55:32 +02:00
|
|
|
diff --git chrome/browser/profiles/renderer_updater_factory.cc chrome/browser/profiles/renderer_updater_factory.cc
|
2023-06-26 12:13:38 +02:00
|
|
|
index 711f449323737..b277b4386c16a 100644
|
2023-05-30 10:55:32 +02:00
|
|
|
--- chrome/browser/profiles/renderer_updater_factory.cc
|
|
|
|
+++ chrome/browser/profiles/renderer_updater_factory.cc
|
|
|
|
@@ -4,6 +4,7 @@
|
|
|
|
|
|
|
|
#include "chrome/browser/profiles/renderer_updater_factory.h"
|
|
|
|
|
|
|
|
+#include "cef/libcef/features/runtime.h"
|
|
|
|
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
|
|
|
#include "chrome/browser/profiles/profile.h"
|
|
|
|
#include "chrome/browser/profiles/renderer_updater.h"
|
|
|
|
@@ -25,7 +26,9 @@ RendererUpdaterFactory::RendererUpdaterFactory()
|
|
|
|
DependsOn(IdentityManagerFactory::GetInstance());
|
|
|
|
DependsOn(HostContentSettingsMapFactory::GetInstance());
|
|
|
|
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
|
|
|
|
+ if (!cef::IsAlloyRuntimeEnabled()) {
|
|
|
|
DependsOn(BoundSessionCookieRefreshServiceFactory::GetInstance());
|
|
|
|
+ }
|
|
|
|
#endif // BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
|
|
|
|
}
|
|
|
|
|