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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 480513004: Stopping the history recording for a supervised user (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made documentation clearer. Created 6 years, 3 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/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 6cd213090fbda233dc55580f9fb306a4ed8a8f9f..564977f24909f543f0a9255b5d28659177739052 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -156,7 +156,8 @@ void SupervisedUserService::URLFilterContext::OnBlacklistLoaded() {
}
SupervisedUserService::SupervisedUserService(Profile* profile)
- : profile_(profile),
+ : includes_sync_sessions_type_(true),
+ profile_(profile),
active_(false),
delegate_(NULL),
#if defined(ENABLE_EXTENSIONS)
@@ -400,7 +401,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);
@@ -410,6 +412,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_);
@@ -680,6 +693,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_);

Powered by Google App Engine
This is Rietveld 408576698