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

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

Issue 2707133006: Start ARC and sign in after Chrome OS login (Closed)
Patch Set: enum, comments Created 3 years, 10 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_session_manager.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc
index 4e4ec241d8ecce91df78072dc59b1317ab96673c..17dafac6871219e811e7066e9bc7cbb360d295aa 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -496,7 +496,7 @@ void ArcSessionManager::StartPreferenceHandler() {
}
// Update the state based on the initial Google Play Store enabled value.
- if (IsArcPlayStoreEnabledForProfile(profile_)) {
+ if (ShouldArcAlwaysStart() || IsArcPlayStoreEnabledForProfile(profile_)) {
hidehiko 2017/03/03 12:52:47 FYI: I landed a CL to extract this part. The rebas
victorhsieh 2017/03/03 18:51:50 Done.
VLOG(1) << "ARC is already enabled.";
DCHECK(!enable_requested_);
RequestEnable();
@@ -550,10 +550,15 @@ void ArcSessionManager::OnOptInPreferenceChanged() {
if (profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled))
ArcAuthNotification::Hide();
- if (is_play_store_enabled)
- RequestEnable();
- else
- RequestDisable();
+ if (ShouldArcAlwaysStart()) {
+ // TODO(victorhsieh): Implement opt-in and opt-out flow. For now, do
+ // nothing but keep the existing ARC instance running.
stevenjb 2017/03/03 18:25:34 nit: Avoid an empty if clause; invert and move the
victorhsieh 2017/03/03 18:51:50 Acknowledged. This is no longer the case after re
+ } else {
+ if (is_play_store_enabled)
+ RequestEnable();
+ else
+ RequestDisable();
+ }
for (auto& observer : observer_list_)
observer.OnArcPlayStoreEnabledChanged(is_play_store_enabled);
@@ -712,12 +717,12 @@ void ArcSessionManager::RequestEnableImpl() {
if (AreArcAllOptInPreferencesManaged())
prefs->SetBoolean(prefs::kArcTermsAccepted, true);
- // If it is marked that sign in has been successfully done, then directly
- // start ARC.
+ // If it is marked that sign in has been successfully done, if ARC has been
+ // set up to always start, then directly start ARC.
// 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) || ShouldArcAlwaysStart() ||
IsArcOptInVerificationDisabled() || IsArcKioskMode()) {
StartArc();

Powered by Google App Engine
This is Rietveld 408576698