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

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

Issue 1829703002: Add ArcEnabled policy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged with https://codereview.chromium.org/1852843003/ Created 4 years, 8 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 | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | chrome/browser/policy/DEPS » ('j') | 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..4d352259d0a9b39ce7ba60d3d340fabb9813a58d 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -224,6 +224,11 @@ void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) {
// In case UI is disabled we assume that ARC is opted-in.
if (!IsOptInVerificationDisabled()) {
+ pref_change_registrar_.Init(profile_->GetPrefs());
+ pref_change_registrar_.Add(
+ prefs::kArcEnabled,
+ base::Bind(&ArcAuthService::OnOptInPreferenceChanged,
bartfab (slow) 2016/04/04 11:57:03 Nit: #include "base/bind.h"
Polina Bondarenko 2016/04/04 12:03:21 Done.
+ base::Unretained(this)));
bartfab (slow) 2016/04/04 11:57:03 Nit: #include "base/bind_helpers.h"
Polina Bondarenko 2016/04/04 12:03:21 Done.
if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) {
OnOptInPreferenceChanged();
} else {
@@ -258,6 +263,7 @@ void ArcAuthService::Shutdown() {
pref_service_syncable->RemoveObserver(this);
pref_service_syncable->RemoveSyncedPrefObserver(prefs::kArcEnabled, this);
}
+ pref_change_registrar_.RemoveAll();
profile_ = nullptr;
}
@@ -321,8 +327,6 @@ void ArcAuthService::OnSyncedPrefChanged(const std::string& path,
? OptInActionType::OPTED_IN
: OptInActionType::OPTED_OUT);
}
-
- OnOptInPreferenceChanged();
}
void ArcAuthService::OnOptInPreferenceChanged() {
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | chrome/browser/policy/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698