Commit 641481d2 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Update IsSystemProfile for OffTheRecord profile.

System profile has a regular and an off-the-record profile. Previously
IsSystemProfile did not return true for the OTR one, now it does.

Bug: 1142370
Change-Id: I5cd6376d58d1110c69d9b359a0eaba0da0f2feb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2516539Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824416}
parent 3787f538
......@@ -144,6 +144,7 @@ void OffTheRecordProfileImpl::Init() {
// Must be done before CreateBrowserContextServices(), since some of them
// change behavior based on whether the provided context is a guest session.
set_is_guest_profile(profile_->IsGuestSession());
set_is_system_profile(profile_->IsSystemProfile());
BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
this);
......
......@@ -382,8 +382,7 @@ bool Profile::IsRegularProfile() const {
}
bool Profile::IsIncognitoProfile() const {
return IsPrimaryOTRProfile() && !IsGuestSession() &&
!GetOriginalProfile()->IsSystemProfile();
return IsPrimaryOTRProfile() && !IsGuestSession() && !IsSystemProfile();
}
// static
......
......@@ -401,8 +401,8 @@ class Profile : public content::BrowserContext {
std::string GetDebugName() const;
// IsRegularProfile() and IsIncognitoProfile() are mutually exclusive.
// IsSystemProfile() implies that IsRegularProfile() is true. Note that system
// profile will also create an OffTheRecord profile.
// IsSystemProfile() returns true for both regular and off-the-record profile
// of the system profile.
// IsOffTheRecord() is true for the off the record profile of Incognito mode,
// system profile, Guest sessions, and also non-primary OffTheRecord profiles.
......
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