chrome: Support usage of the Chrome toolbar from Views (see issue #2969)

This commit is contained in:
Marshall Greenblatt
2021-04-11 16:10:11 -04:00
parent 9c82785077
commit a4603c6f1a
55 changed files with 1057 additions and 156 deletions

View File

@ -34,7 +34,7 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) {
if (cache_path_ == user_data_dir) {
// Use the default disk-based profile.
auto profile = profile_manager->GetActiveUserProfile();
auto profile = profile_manager->GetPrimaryUserProfile();
ProfileCreated(profile, Profile::CreateStatus::CREATE_STATUS_CREATED);
ProfileCreated(profile, Profile::CreateStatus::CREATE_STATUS_INITIALIZED);
return;
@ -63,7 +63,7 @@ void ChromeBrowserContext::Shutdown() {
// |g_browser_process| may be nullptr during shutdown.
if (should_destroy_ && g_browser_process) {
g_browser_process->profile_manager()
->GetActiveUserProfile()
->GetPrimaryUserProfile()
->DestroyOffTheRecordProfile(profile_);
}
profile_ = nullptr;
@ -83,7 +83,7 @@ void ChromeBrowserContext::ProfileCreated(Profile* profile,
// new/unique OffTheRecord profile instead.
const auto& profile_id = Profile::OTRProfileID::CreateUniqueForCEF();
parent_profile =
g_browser_process->profile_manager()->GetActiveUserProfile();
g_browser_process->profile_manager()->GetPrimaryUserProfile();
profile_ = parent_profile->GetOffTheRecordProfile(profile_id);
otr_profile = static_cast<OffTheRecordProfileImpl*>(profile_);
status = Profile::CreateStatus::CREATE_STATUS_INITIALIZED;