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 7eab36a63c72b086c0c29b6e9e06b531d7179912..0083fec91e36da989b2fa5c32e3fdd675bbf9a20 100644 |
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc |
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc |
@@ -395,6 +395,7 @@ void ArcSessionManager::OnPrimaryUserProfilePrepared(Profile* profile) { |
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
DCHECK(profile && profile != profile_); |
+ // TODO(victorhsieh): Keep using the instance from login screen when ready. |
Shutdown(); |
if (!IsArcAllowedForProfile(profile)) |
@@ -449,7 +450,7 @@ void ArcSessionManager::OnPrimaryUserProfilePrepared(Profile* profile) { |
RemoveArcData(); |
} |
- if (IsArcPlayStoreEnabled()) { |
+ if (ShouldAlwaysStartArc() || IsArcPlayStoreEnabled()) { |
VLOG(1) << "ARC is already enabled."; |
DCHECK(!enable_requested_); |
RequestEnable(); |
@@ -513,13 +514,13 @@ void ArcSessionManager::OnOptInPreferenceChanged() { |
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
DCHECK(profile_); |
- const bool arc_enabled = IsArcPlayStoreEnabled(); |
+ const bool play_store_enabled = IsArcPlayStoreEnabled(); |
if (!IsArcManaged()) { |
// Update UMA only for non-Managed cases. |
- UpdateOptInActionUMA(arc_enabled ? OptInActionType::OPTED_IN |
- : OptInActionType::OPTED_OUT); |
+ UpdateOptInActionUMA(play_store_enabled ? OptInActionType::OPTED_IN |
+ : OptInActionType::OPTED_OUT); |
- if (!arc_enabled) { |
+ if (!play_store_enabled) { |
// Remove the pinned Play Store icon launcher in Shelf. |
// This is only for non-Managed cases. In managed cases, it is expected |
// to be "disabled" rather than "removed", so keep it here. |
@@ -539,13 +540,18 @@ void ArcSessionManager::OnOptInPreferenceChanged() { |
ArcAuthNotification::Hide(); |
} |
- if (arc_enabled) |
- RequestEnable(); |
- else |
- RequestDisable(); |
+ if (ShouldAlwaysStartArc()) { |
+ // TODO(victorhsieh): Implement opt-in and opt-out flow. For now, do |
+ // nothing but keep the existing ARC instance running. |
+ } else { |
+ if (play_store_enabled) |
+ RequestEnable(); |
+ else |
+ RequestDisable(); |
+ } |
for (auto& observer : observer_list_) |
- observer.OnArcPlayStoreEnabledChanged(arc_enabled); |
+ observer.OnArcPlayStoreEnabledChanged(play_store_enabled); |
} |
void ArcSessionManager::ShutdownSession() { |
@@ -733,7 +739,7 @@ void ArcSessionManager::RequestEnableImpl() { |
// For testing, and for Kiosk mode, we also skip ToS negotiation procedure. |
// For backward compatibility, this check needs to be prior to the |
// kArcTermsAccepted check below. |
- if (prefs->GetBoolean(prefs::kArcSignedIn) || |
+ if (prefs->GetBoolean(prefs::kArcSignedIn) || ShouldAlwaysStartArc() || |
IsArcOptInVerificationDisabled() || IsArcKioskMode()) { |
StartArc(); |