Commit 5ac5483e authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Update OTR Profile API usage in AppController.

Profile API is being updated (issue 1033903) and the usage of
GetOffTheRecordProfile and HasOffTheRecordProfile without argument is
getting deprecated. Use cases of this call that ONLY refer to incognito
or guest mode can use [Get/Has]PrimaryOTRProfile() instead.

Usage of these API functions are updated in AppController.

Bug: 1060940
Change-Id: Icd809c023b069c83c426c362efe1303fbc8a40c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388463Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803920}
parent 3879cac2
......@@ -135,7 +135,7 @@ bool g_is_opening_new_window = false;
// there are only minimized windows), it will unminimize it.
Browser* ActivateBrowser(Profile* profile) {
Browser* browser = chrome::FindLastActiveWithProfile(
profile->IsGuestSession() ? profile->GetOffTheRecordProfile() : profile);
profile->IsGuestSession() ? profile->GetPrimaryOTRProfile() : profile);
if (browser)
browser->window()->Activate();
return browser;
......@@ -861,8 +861,8 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
std::vector<Profile*> added_profiles;
for (Profile* p : profiles) {
if (p->HasOffTheRecordProfile())
added_profiles.push_back(p->GetOffTheRecordProfile());
for (Profile* otr : p->GetAllOffTheRecordProfiles())
added_profiles.push_back(otr);
}
profiles.insert(profiles.end(), added_profiles.begin(), added_profiles.end());
......@@ -1073,7 +1073,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
IDC_FOCUS_SEARCH);
break;
case IDC_NEW_INCOGNITO_WINDOW:
CreateBrowser(lastProfile->GetOffTheRecordProfile());
CreateBrowser(lastProfile->GetPrimaryOTRProfile());
break;
case IDC_RESTORE_TAB:
chrome::OpenWindowWithRestoredTabs(lastProfile);
......@@ -1364,7 +1364,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
// Guest sessions must always be OffTheRecord. Use that when opening windows.
if (profile->IsGuestSession())
return profile->GetOffTheRecordProfile();
return profile->GetPrimaryOTRProfile();
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