Commit f0b90de6 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Update usage of GetOffTheRecordProfile in ProfileHelperImpl.

Profile API is being updated (issue 1033903) and the usage of
GetOffTheRecordProfile without argument is getting deprecated. Use cases
of this call that only refer to incognito or guest mode can use
GetPrimaryOTRProfile() instead.

All calls to this function in ProfileHelperImpl are updated.
This CL does not make any behavioral changes.

Bug: 1060940
Change-Id: I946e0e39817ab32ce07a93009dddf5c5aef3019b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2143813Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758130}
parent 833ead46
...@@ -246,7 +246,7 @@ base::FilePath ProfileHelper::GetSigninProfileDir() { ...@@ -246,7 +246,7 @@ base::FilePath ProfileHelper::GetSigninProfileDir() {
Profile* ProfileHelper::GetSigninProfile() { Profile* ProfileHelper::GetSigninProfile() {
ProfileManager* profile_manager = g_browser_process->profile_manager(); ProfileManager* profile_manager = g_browser_process->profile_manager();
return profile_manager->GetProfile(GetSigninProfileDir()) return profile_manager->GetProfile(GetSigninProfileDir())
->GetOffTheRecordProfile(); ->GetPrimaryOTRProfile();
} }
// static // static
...@@ -407,9 +407,9 @@ ProfileHelperImpl::~ProfileHelperImpl() { ...@@ -407,9 +407,9 @@ ProfileHelperImpl::~ProfileHelperImpl() {
void ProfileHelperImpl::ProfileStartup(Profile* profile) { void ProfileHelperImpl::ProfileStartup(Profile* profile) {
// Initialize Chrome OS preferences like touch pad sensitivity. For the // Initialize Chrome OS preferences like touch pad sensitivity. For the
// preferences to work in the guest mode, the initialization has to be // preferences to work in the guest mode, the initialization has to be
// done after |profile| is switched to the incognito profile (which // done after |profile| is switched to the off-the-record profile (which
// is actually GuestSessionProfile in the guest mode). See the // is actually GuestSessionProfile in the guest mode). See the
// GetOffTheRecordProfile() call above. // GetPrimaryOTRProfile() call above.
profile->InitChromeOSPreferences(); profile->InitChromeOSPreferences();
// Add observer so we can see when the first profile's session restore is // Add observer so we can see when the first profile's session restore is
...@@ -521,9 +521,9 @@ Profile* ProfileHelperImpl::GetProfileByUser(const user_manager::User* user) { ...@@ -521,9 +521,9 @@ Profile* ProfileHelperImpl::GetProfileByUser(const user_manager::User* user) {
Profile* profile = GetProfileByUserIdHash(user->username_hash()); Profile* profile = GetProfileByUserIdHash(user->username_hash());
// GetActiveUserProfile() or GetProfileByUserIdHash() returns a new instance // GetActiveUserProfile() or GetProfileByUserIdHash() returns a new instance
// of ProfileImpl(), but actually its OffTheRecordProfile() should be used. // of ProfileImpl(), but actually its off-the-record profile should be used.
if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) if (user_manager::UserManager::Get()->IsLoggedInAsGuest())
profile = profile->GetOffTheRecordProfile(); profile = profile->GetPrimaryOTRProfile();
return profile; return profile;
} }
...@@ -550,9 +550,9 @@ Profile* ProfileHelperImpl::GetProfileByUserUnsafe( ...@@ -550,9 +550,9 @@ Profile* ProfileHelperImpl::GetProfileByUserUnsafe(
} }
// GetActiveUserProfile() or GetProfileByUserIdHash() returns a new instance // GetActiveUserProfile() or GetProfileByUserIdHash() returns a new instance
// of ProfileImpl(), but actually its OffTheRecordProfile() should be used. // of ProfileImpl(), but actually its off-the-record profile should be used.
if (profile && user_manager::UserManager::Get()->IsLoggedInAsGuest()) if (profile && user_manager::UserManager::Get()->IsLoggedInAsGuest())
profile = profile->GetOffTheRecordProfile(); profile = profile->GetPrimaryOTRProfile();
return profile; return profile;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment