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

Update IsIncognitoProfile to return false for OTR of System profile.

System profiles create a primary off-the-record profile.
|IsIncognitoProfile| function is updated to return false for this OTR
profile.

Bug: 1143077, 1125474
Change-Id: Ib0763eabb154556c96fb47add3b738372edf8555
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2504231Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarDavid Benjamin <davidben@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822161}
parent ce2a330e
......@@ -159,6 +159,10 @@ bool IsAmbientAuthAllowedForProfile(Profile* profile) {
type == net::AmbientAuthAllowedProfileTypes::ALL;
}
// System profile does not need ambient authentication.
if (profile->GetOriginalProfile()->IsSystemProfile())
return false;
// Profile type not yet supported.
NOTREACHED();
......
......@@ -372,7 +372,8 @@ bool Profile::IsRegularProfile() const {
}
bool Profile::IsIncognitoProfile() const {
return IsPrimaryOTRProfile() && !IsGuestSession();
return IsPrimaryOTRProfile() && !IsGuestSession() &&
!GetOriginalProfile()->IsSystemProfile();
}
// static
......
......@@ -398,9 +398,10 @@ class Profile : public content::BrowserContext {
std::string GetDebugName() const;
// IsRegularProfile() and IsIncognitoProfile() are mutually exclusive.
// IsSystemProfile() implies that IsRegularProfile() is true.
// IsOffTheRecord() is true for the off the record profile of incognito mode
// and guest sessions, and also non-primary OffTheRecord profiles.
// IsSystemProfile() implies that IsRegularProfile() is true. Note that system
// profile will also create an OffTheRecord profile.
// IsOffTheRecord() is true for the off the record profile of Incognito mode,
// system profile, Guest sessions, and also non-primary OffTheRecord profiles.
// Returns whether it's a regular profile.
bool IsRegularProfile() const;
......
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