| 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 8b45a60a84a11951dcdffcfeebc45f1185df2bdc..f288e2a0eb48e2e031718e7f4eb206d092347898 100644
|
| --- a/chrome/browser/supervised_user/supervised_user_service.cc
|
| +++ b/chrome/browser/supervised_user/supervised_user_service.cc
|
| @@ -132,7 +132,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)
|
| @@ -359,7 +360,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);
|
| @@ -369,6 +371,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_);
|
| @@ -608,6 +621,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_);
|
|
|