Index: chrome/browser/supervised_user/supervised_user_service.cc |
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc |
index 0f8cab2f3cb885db170bf02894ebc9d63f0c153e..929fc486d7f39bf883afe42729f91cbf5d991e73 100644 |
--- a/chrome/browser/supervised_user/supervised_user_service.cc |
+++ b/chrome/browser/supervised_user/supervised_user_service.cc |
@@ -133,7 +133,8 @@ void SupervisedUserService::URLFilterContext::SetManualURLs( |
} |
SupervisedUserService::SupervisedUserService(Profile* profile) |
- : profile_(profile), |
+ : includes_sync_sessions_type_(true), |
+ profile_(profile), |
active_(false), |
delegate_(NULL), |
#if defined(ENABLE_EXTENSIONS) |
@@ -363,7 +364,8 @@ syncer::ModelTypeSet SupervisedUserService::GetPreferredDataTypes() const { |
return syncer::ModelTypeSet(); |
syncer::ModelTypeSet result; |
- result.Put(syncer::SESSIONS); |
+ if (IncludesSyncSessionsType()) |
+ result.Put(syncer::SESSIONS); |
result.Put(syncer::EXTENSIONS); |
result.Put(syncer::EXTENSION_SETTINGS); |
result.Put(syncer::APPS); |
@@ -373,6 +375,17 @@ syncer::ModelTypeSet SupervisedUserService::GetPreferredDataTypes() const { |
return result; |
} |
+void SupervisedUserService::OnHistoryRecordingStateChanged() { |
+ includes_sync_sessions_type_ = |
+ profile_->GetPrefs()->GetBoolean(prefs::kRecordHistory); |
+ ProfileSyncServiceFactory::GetForProfile(profile_) |
+ ->ReconfigureDatatypeManager(); |
+} |
+ |
+bool SupervisedUserService::IncludesSyncSessionsType() const { |
+ return includes_sync_sessions_type_; |
+} |
+ |
void SupervisedUserService::OnStateChanged() { |
ProfileSyncService* service = |
ProfileSyncServiceFactory::GetForProfile(profile_); |
@@ -612,6 +625,10 @@ void SupervisedUserService::Init() { |
prefs::kSupervisedUserId, |
base::Bind(&SupervisedUserService::OnSupervisedUserIdChanged, |
base::Unretained(this))); |
+ pref_change_registrar_.Add( |
+ prefs::kRecordHistory, |
+ base::Bind(&SupervisedUserService::OnHistoryRecordingStateChanged, |
+ base::Unretained(this))); |
ProfileSyncService* sync_service = |
ProfileSyncServiceFactory::GetForProfile(profile_); |