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

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

Issue 1854463002: arc: Fix issue when Arc OptIn is not started on fresh devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0781a0124631387d85c13cfb7c5d9cf4099043be..fc2082532984647f5fba446fcc7aff130bf89d45 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -228,10 +228,8 @@ void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) {
OnOptInPreferenceChanged();
} else {
UpdateEnabledStateUMA(false);
- if (!disable_ui_for_testing && profile_->IsNewProfile()) {
- PrefServiceSyncableFromProfile(profile_)->AddObserver(this);
- OnIsSyncingChanged();
- }
+ PrefServiceSyncableFromProfile(profile_)->AddObserver(this);
khmel 2016/03/31 22:19:21 In one of the recent CLs I changed observer scheme
+ OnIsSyncingChanged();
}
} else {
auth_code_.clear();
@@ -246,8 +244,14 @@ void ArcAuthService::OnIsSyncingChanged() {
return;
pref_service_syncable->RemoveObserver(this);
- if (!profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled))
+
+ if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled))
+ OnOptInPreferenceChanged();
+
+ if (!disable_ui_for_testing && profile_->IsNewProfile() &&
xiyuan 2016/03/31 22:32:44 nit: profile_->IsNewProfile() might not be necessa
khmel 2016/03/31 22:47:34 I think it might be required. For example: User st
xiyuan 2016/03/31 22:50:50 Okay. That sounds like a valid case.
+ !profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) {
arc::ArcAuthNotification::Show();
+ }
}
void ArcAuthService::Shutdown() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698