Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3494)

Unified Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2926893002: arc: Start ARC for Public Session users.
Patch Set: Update unit tests. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_session_manager.cc » ('j') | chrome/browser/chromeos/arc/arc_session_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698