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

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

Issue 2926893002: arc: Start ARC for Public Session users.
Patch Set: Fix missed IsPublicSessionMode() checks. Created 3 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_util_unittest.cc » ('j') | components/arc/arc_util.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_session_manager.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc
index 38c5ae2bf1785dc4636514f5773f27b2890af2d1..915bdf846761806b0a4e4a47b57591fc70080735 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -275,7 +275,8 @@ void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) {
scoped_opt_in_tracker_->TrackError();
if (result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) {
- if (IsArcKioskMode()) {
+ // TODO(poromov): Consider PublicSession offline mode.
+ if (IsArcKioskMode() || IsPublicSessionMode()) {
VLOG(1) << "Robot account auth code fetching error";
// Log out the user. All the cleanup will be done in Shutdown() method.
// The callback is not called because auth code is empty.
@@ -317,12 +318,17 @@ void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) {
// * In case ARC is enabled from OOBE.
// * In ARC Kiosk mode, because the only one UI in kiosk mode must be the
// kiosk app and device is not needed for opt-in;
+ // * In Public Session mode, because Play Store will be hidden from users
+ // and only apps configured by policy should be installed.
// * When ARC is managed and all OptIn preferences are managed/unused, too,
// because the whole OptIn flow should happen as seamless as possible for
// the user.
+ // For Active Directory users we always show a page notifying them that they
+ // have to authenticate with their identity provider (through SAML) to make
+ // it less weird that a browser window pops up.
const bool suppress_play_store_app =
!IsPlayStoreAvailable() || IsArcOptInVerificationDisabled() ||
- IsArcKioskMode() || oobe_start_ ||
+ IsArcKioskMode() || IsPublicSessionMode() || oobe_start_ ||
(IsArcPlayStoreEnabledPreferenceManagedForProfile(profile_) &&
AreArcAllOptInPreferencesIgnorableForProfile(profile_));
if (!suppress_play_store_app) {
@@ -432,7 +438,7 @@ void ArcSessionManager::Initialize() {
// in typical use case there will be no one nearby the kiosk device, who can
// do some action to solve the problem be means of UI.
if (!g_disable_ui_for_testing && !IsArcOptInVerificationDisabled() &&
- !IsArcKioskMode()) {
+ !IsArcKioskMode() && !IsPublicSessionMode()) {
DCHECK(!support_host_);
support_host_ = base::MakeUnique<ArcSupportHost>(profile_);
support_host_->SetErrorDelegate(this);
@@ -627,10 +633,12 @@ bool ArcSessionManager::RequestEnableImpl() {
// set up to always start, then directly start ARC.
// For Kiosk mode, skip ToS because it is very likely that near the device
// there will be no one who is eligible to accept them.
- // If opt-in verification is disabled, skip negotiation, too. This is for
- // testing purpose.
+ // In Public Session mode ARC should be started silently without user
+ // interaction. If opt-in verification is disabled, skip negotiation, too.
+ // This is for testing purpose.
const bool start_arc_directly = prefs->GetBoolean(prefs::kArcSignedIn) ||
ShouldArcAlwaysStart() || IsArcKioskMode() ||
+ IsPublicSessionMode() ||
IsArcOptInVerificationDisabled();
// When ARC is blocked because of filesystem compatibility, do not proceed
@@ -735,9 +743,10 @@ void ArcSessionManager::MaybeStartTermsOfServiceNegotiation() {
DCHECK(profile_);
DCHECK(arc_session_runner_->IsStopped());
DCHECK(!terms_of_service_negotiator_);
- // In Kiosk-mode, Terms of Service negotiation should be skipped.
- // See also RequestEnableImpl().
+ // In Kiosk and PublicSession-mode, Terms of Service negotiation should be
Luis Héctor Chávez 2017/08/28 18:33:28 nit: Public Session (for consistency)
Sergey Poromov 2017/08/28 18:47:24 Done.
+ // skipped. See also RequestEnableImpl().
DCHECK(!IsArcKioskMode());
+ DCHECK(!IsPublicSessionMode());
// If opt-in verification is disabled, Terms of Service negotiation should
// be skipped, too. See also RequestEnableImpl().
DCHECK(!IsArcOptInVerificationDisabled());
@@ -900,9 +909,10 @@ void ArcSessionManager::StartBackgroundAndroidManagementCheck() {
DCHECK(!android_management_checker_);
// Skip Android management check for testing.
- // We also skip if Android management check for Kiosk mode,
- // because there are no managed human users for Kiosk exist.
+ // We also skip if Android management check for Kiosk and Public Session mode,
+ // because there are no managed human users for them exist.
if (IsArcOptInVerificationDisabled() || IsArcKioskMode() ||
+ IsPublicSessionMode() ||
(g_disable_ui_for_testing &&
!g_enable_check_android_management_for_testing)) {
return;
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_util_unittest.cc » ('j') | components/arc/arc_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698