Commit 23c68651 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Update IncognitoModePrefs::CanOpenBrowser to use IsIncognitoProfile.

CanOpenBrowser used IsOffTheRecordProfile instead of IsIncognitoProfile,
applying incognito policy selections on all OTR profiles.

It's now updated to only affect incognito.

Bug: 1033903, 968028
Change-Id: I889cbbcacfe2fb0a42c81debc6d738487e1fdd5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2249932Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781250}
parent df674d44
......@@ -77,18 +77,15 @@ bool IncognitoModePrefs::ShouldLaunchIncognito(
// static
bool IncognitoModePrefs::CanOpenBrowser(Profile* profile) {
if (profile->IsGuestSession())
return true;
switch (GetAvailability(profile->GetPrefs())) {
case IncognitoModePrefs::ENABLED:
return true;
case IncognitoModePrefs::DISABLED:
return !profile->IsOffTheRecord();
return !profile->IsIncognitoProfile();
case IncognitoModePrefs::FORCED:
return profile->IsOffTheRecord();
return profile->IsIncognitoProfile();
default:
NOTREACHED();
......
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