Index: chrome/browser/chromeos/arc/arc_auth_service.cc |
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc |
index b90cf0d1b515d45caed009ab95972165b8290ac7..2243486e6e4c80bea281294f26008c1ff76994de 100644 |
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc |
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc |
@@ -63,8 +63,9 @@ ProvisioningResult ConvertArcSignInFailureReasonToProvisioningResult( |
} |
mojom::ChromeAccountType GetAccountType() { |
- return IsArcKioskMode() ? mojom::ChromeAccountType::ROBOT_ACCOUNT |
- : mojom::ChromeAccountType::USER_ACCOUNT; |
+ return IsArcKioskMode() || IsPublicSessionMode() |
+ ? mojom::ChromeAccountType::ROBOT_ACCOUNT |
+ : mojom::ChromeAccountType::USER_ACCOUNT; |
} |
} // namespace |
@@ -218,7 +219,7 @@ void ArcAuthService::GetAuthCodeDeprecated( |
const GetAuthCodeDeprecatedCallback& callback) { |
// For robot account we must use RequestAccountInfo because it allows |
// to specify account type. |
- DCHECK(!IsArcKioskMode()); |
+ DCHECK(!IsArcKioskMode() && !IsPublicSessionMode()); |
RequestAccountInfoInternal( |
base::MakeUnique<ArcAuthService::AccountInfoNotifier>(callback)); |
} |
@@ -272,8 +273,8 @@ void ArcAuthService::RequestAccountInfoInternal( |
} |
// For non-AD enrolled devices an auth code is fetched. |
std::unique_ptr<ArcAuthCodeFetcher> auth_code_fetcher; |
- if (IsArcKioskMode()) { |
- // In Kiosk mode, use Robot auth code fetching. |
+ if (IsArcKioskMode() || IsPublicSessionMode()) { |
+ // In Kiosk and public session mode, use Robot auth code fetching. |
auth_code_fetcher = base::MakeUnique<ArcRobotAuthCodeFetcher>(); |
} else if (base::FeatureList::IsEnabled(arc::kArcUseAuthEndpointFeature)) { |
// Optionally retrieve auth code in silent mode. |
@@ -287,7 +288,8 @@ void ArcAuthService::RequestAccountInfoInternal( |
// Otherwise, show LSO page and let user click "Sign in" button. |
// Here, support_host should be available always. The case support_host is |
// not created is when 1) IsArcOptInVerificationDisabled() is true or 2) |
- // IsArcKioskMode() is true. Both cases are handled above. |
+ // IsArcKioskMode() or IsPublicSessionMode() is true. |
+ // Both cases are handled above. |
auth_code_fetcher = base::MakeUnique<ArcManualAuthCodeFetcher>( |
ArcSessionManager::Get()->auth_context(), |
ArcSessionManager::Get()->support_host()); |