Commit 81f6d602 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Deprecate prefs::kForceSessionSync

This pref was only used for legacy supervised users, based on
supervised_users::kRecordHistoryIncludesSessionSync. Legacy supervised
users don't exist anymore, so no need to keep this around.

Bug: none
Change-Id: I34a3661bba4e9ebc4e89677749f4c0ee001d908d
Reviewed-on: https://chromium-review.googlesource.com/c/1314492
Commit-Queue: Marc Treib <treib@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606007}
parent ecee78d8
...@@ -379,6 +379,7 @@ const char kReverseAutologinEnabled[] = "reverse_autologin.enabled"; ...@@ -379,6 +379,7 @@ const char kReverseAutologinEnabled[] = "reverse_autologin.enabled";
// Deprecated 11/2018. // Deprecated 11/2018.
const char kNetworkQualities[] = "net.network_qualities"; const char kNetworkQualities[] = "net.network_qualities";
const char kForceSessionSync[] = "settings.history_recorded";
// Register prefs used only for migration (clearing or moving to a new key). // Register prefs used only for migration (clearing or moving to a new key).
void RegisterProfilePrefsForMigration( void RegisterProfilePrefsForMigration(
...@@ -407,6 +408,7 @@ void RegisterProfilePrefsForMigration( ...@@ -407,6 +408,7 @@ void RegisterProfilePrefsForMigration(
registry->RegisterBooleanPref(kReverseAutologinEnabled, true); registry->RegisterBooleanPref(kReverseAutologinEnabled, true);
registry->RegisterDictionaryPref(kNetworkQualities, PrefRegistry::LOSSY_PREF); registry->RegisterDictionaryPref(kNetworkQualities, PrefRegistry::LOSSY_PREF);
registry->RegisterBooleanPref(kForceSessionSync, false);
} }
} // namespace } // namespace
...@@ -868,4 +870,5 @@ void MigrateObsoleteProfilePrefs(Profile* profile) { ...@@ -868,4 +870,5 @@ void MigrateObsoleteProfilePrefs(Profile* profile) {
// Added 11/2018. // Added 11/2018.
profile_prefs->ClearPref(kNetworkQualities); profile_prefs->ClearPref(kNetworkQualities);
profile_prefs->ClearPref(kForceSessionSync);
} }
...@@ -379,7 +379,6 @@ void ProfileImpl::RegisterProfilePrefs( ...@@ -379,7 +379,6 @@ void ProfileImpl::RegisterProfilePrefs(
registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false); registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false);
registry->RegisterIntegerPref(prefs::kForceYouTubeRestrict, registry->RegisterIntegerPref(prefs::kForceYouTubeRestrict,
safe_search_util::YOUTUBE_RESTRICT_OFF); safe_search_util::YOUTUBE_RESTRICT_OFF);
registry->RegisterBooleanPref(prefs::kForceSessionSync, false);
registry->RegisterStringPref(prefs::kAllowedDomainsForApps, std::string()); registry->RegisterStringPref(prefs::kAllowedDomainsForApps, std::string());
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
......
...@@ -169,10 +169,6 @@ bool ChildAccountService::SetActive(bool active) { ...@@ -169,10 +169,6 @@ bool ChildAccountService::SetActive(bool active) {
SupervisedUserSettingsService* settings_service = SupervisedUserSettingsService* settings_service =
SupervisedUserSettingsServiceFactory::GetForProfile(profile_); SupervisedUserSettingsServiceFactory::GetForProfile(profile_);
settings_service->SetLocalSetting(
supervised_users::kRecordHistoryIncludesSessionSync,
std::make_unique<base::Value>(false));
// In contrast to legacy SUs, child account SUs must sign in. // In contrast to legacy SUs, child account SUs must sign in.
settings_service->SetLocalSetting(supervised_users::kSigninAllowed, settings_service->SetLocalSetting(supervised_users::kSigninAllowed,
std::make_unique<base::Value>(true)); std::make_unique<base::Value>(true));
...@@ -215,8 +211,6 @@ bool ChildAccountService::SetActive(bool active) { ...@@ -215,8 +211,6 @@ bool ChildAccountService::SetActive(bool active) {
} else { } else {
SupervisedUserSettingsService* settings_service = SupervisedUserSettingsService* settings_service =
SupervisedUserSettingsServiceFactory::GetForProfile(profile_); SupervisedUserSettingsServiceFactory::GetForProfile(profile_);
settings_service->SetLocalSetting(
supervised_users::kRecordHistoryIncludesSessionSync, nullptr);
settings_service->SetLocalSetting(supervised_users::kSigninAllowed, settings_service->SetLocalSetting(supervised_users::kSigninAllowed,
nullptr); nullptr);
settings_service->SetLocalSetting(supervised_users::kCookiesAlwaysAllowed, settings_service->SetLocalSetting(supervised_users::kCookiesAlwaysAllowed,
......
...@@ -21,8 +21,6 @@ const char kCookiesAlwaysAllowed[] = "CookiesAlwaysAllowed"; ...@@ -21,8 +21,6 @@ const char kCookiesAlwaysAllowed[] = "CookiesAlwaysAllowed";
const char kForceSafeSearch[] = "ForceSafeSearch"; const char kForceSafeSearch[] = "ForceSafeSearch";
const char kGeolocationDisabled[] = "GeolocationDisabled"; const char kGeolocationDisabled[] = "GeolocationDisabled";
const char kRecordHistory[] = "RecordHistory"; const char kRecordHistory[] = "RecordHistory";
const char kRecordHistoryIncludesSessionSync[] =
"RecordHistoryIncludesSessionSync";
const char kSafeSitesEnabled[] = "SafeSites"; const char kSafeSitesEnabled[] = "SafeSites";
const char kSigninAllowed[] = "SigninAllowed"; const char kSigninAllowed[] = "SigninAllowed";
const char kUserName[] = "UserName"; const char kUserName[] = "UserName";
......
...@@ -22,7 +22,6 @@ extern const char kCookiesAlwaysAllowed[]; ...@@ -22,7 +22,6 @@ extern const char kCookiesAlwaysAllowed[];
extern const char kForceSafeSearch[]; extern const char kForceSafeSearch[];
extern const char kGeolocationDisabled[]; extern const char kGeolocationDisabled[];
extern const char kRecordHistory[]; extern const char kRecordHistory[];
extern const char kRecordHistoryIncludesSessionSync[];
extern const char kSafeSitesEnabled[]; extern const char kSafeSitesEnabled[];
extern const char kSigninAllowed[]; extern const char kSigninAllowed[];
extern const char kUserName[]; extern const char kUserName[];
......
...@@ -148,13 +148,6 @@ void SupervisedUserPrefStore::OnNewSettingsAvailable( ...@@ -148,13 +148,6 @@ void SupervisedUserPrefStore::OnNewSettingsAvailable(
prefs_->SetInteger(prefs::kIncognitoModeAvailability, prefs_->SetInteger(prefs::kIncognitoModeAvailability,
record_history ? IncognitoModePrefs::DISABLED record_history ? IncognitoModePrefs::DISABLED
: IncognitoModePrefs::ENABLED); : IncognitoModePrefs::ENABLED);
bool record_history_includes_session_sync = true;
settings->GetBoolean(supervised_users::kRecordHistoryIncludesSessionSync,
&record_history_includes_session_sync);
prefs_->SetBoolean(
prefs::kForceSessionSync,
record_history && record_history_includes_session_sync);
} }
{ {
......
...@@ -163,10 +163,6 @@ void SupervisedUserService::Init() { ...@@ -163,10 +163,6 @@ void SupervisedUserService::Init() {
prefs::kSupervisedUserId, prefs::kSupervisedUserId,
base::Bind(&SupervisedUserService::OnSupervisedUserIdChanged, base::Bind(&SupervisedUserService::OnSupervisedUserIdChanged,
base::Unretained(this))); base::Unretained(this)));
pref_change_registrar_.Add(
prefs::kForceSessionSync,
base::Bind(&SupervisedUserService::OnForceSessionSyncChanged,
base::Unretained(this)));
browser_sync::ProfileSyncService* sync_service = browser_sync::ProfileSyncService* sync_service =
ProfileSyncServiceFactory::GetForProfile(profile_); ProfileSyncServiceFactory::GetForProfile(profile_);
...@@ -353,13 +349,8 @@ void SupervisedUserService::SetSafeSearchURLReporter( ...@@ -353,13 +349,8 @@ void SupervisedUserService::SetSafeSearchURLReporter(
url_reporter_ = std::move(reporter); url_reporter_ = std::move(reporter);
} }
bool SupervisedUserService::IncludesSyncSessionsType() const {
return includes_sync_sessions_type_;
}
SupervisedUserService::SupervisedUserService(Profile* profile) SupervisedUserService::SupervisedUserService(Profile* profile)
: includes_sync_sessions_type_(true), : profile_(profile),
profile_(profile),
active_(false), active_(false),
delegate_(NULL), delegate_(NULL),
is_profile_active_(false), is_profile_active_(false),
...@@ -719,13 +710,6 @@ void SupervisedUserService::UpdateManualURLs() { ...@@ -719,13 +710,6 @@ void SupervisedUserService::UpdateManualURLs() {
observer.OnURLFilterChanged(); observer.OnURLFilterChanged();
} }
void SupervisedUserService::OnForceSessionSyncChanged() {
includes_sync_sessions_type_ =
profile_->GetPrefs()->GetBoolean(prefs::kForceSessionSync);
ProfileSyncServiceFactory::GetForProfile(profile_)
->ReconfigureDatatypeManager(/*bypass_setup_in_progress_check=*/false);
}
void SupervisedUserService::Shutdown() { void SupervisedUserService::Shutdown() {
if (!did_init_) if (!did_init_)
return; return;
...@@ -1004,8 +988,6 @@ syncer::ModelTypeSet SupervisedUserService::GetPreferredDataTypes() const { ...@@ -1004,8 +988,6 @@ syncer::ModelTypeSet SupervisedUserService::GetPreferredDataTypes() const {
return syncer::ModelTypeSet(); return syncer::ModelTypeSet();
syncer::ModelTypeSet result; syncer::ModelTypeSet result;
if (IncludesSyncSessionsType())
result.Put(syncer::SESSIONS);
result.Put(syncer::EXTENSIONS); result.Put(syncer::EXTENSIONS);
result.Put(syncer::EXTENSION_SETTINGS); result.Put(syncer::EXTENSION_SETTINGS);
result.Put(syncer::APPS); result.Put(syncer::APPS);
......
...@@ -170,10 +170,6 @@ class SupervisedUserService : public KeyedService, ...@@ -170,10 +170,6 @@ class SupervisedUserService : public KeyedService,
void SetSafeSearchURLReporter( void SetSafeSearchURLReporter(
std::unique_ptr<SafeSearchURLReporter> reporter); std::unique_ptr<SafeSearchURLReporter> reporter);
// Returns true if the syncer::SESSIONS type should be included in Sync.
// Public for testing.
bool IncludesSyncSessionsType() const;
// ProfileKeyedService override: // ProfileKeyedService override:
void Shutdown() override; void Shutdown() override;
...@@ -308,16 +304,6 @@ class SupervisedUserService : public KeyedService, ...@@ -308,16 +304,6 @@ class SupervisedUserService : public KeyedService,
// corresponding preference is changed. // corresponding preference is changed.
void UpdateManualURLs(); void UpdateManualURLs();
// Subscribes to the SupervisedUserPrefStore, refreshes
// |includes_sync_sessions_type_| and triggers reconfiguring the
// ProfileSyncService.
void OnForceSessionSyncChanged();
// The option a custodian sets to either record or prevent recording the
// supervised user's history. Set by |FetchNewSessionSyncState()| and
// defaults to true.
bool includes_sync_sessions_type_;
// Owns us via the KeyedService mechanism. // Owns us via the KeyedService mechanism.
Profile* profile_; Profile* profile_;
......
...@@ -214,13 +214,6 @@ class SupervisedUserServiceTest : public ::testing::Test { ...@@ -214,13 +214,6 @@ class SupervisedUserServiceTest : public ::testing::Test {
} // namespace } // namespace
TEST_F(SupervisedUserServiceTest, ChangesIncludedSessionOnChangedSettings) {
supervised_user_service_->Init();
EXPECT_TRUE(supervised_user_service_->IncludesSyncSessionsType());
profile_->GetPrefs()->SetBoolean(prefs::kForceSessionSync, false);
EXPECT_FALSE(supervised_user_service_->IncludesSyncSessionsType());
}
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
// Ensure that the CustodianProfileDownloaderService shuts down cleanly. If no // Ensure that the CustodianProfileDownloaderService shuts down cleanly. If no
// DCHECK is hit when the service is destroyed, this test passed. // DCHECK is hit when the service is destroyed, this test passed.
......
...@@ -914,10 +914,6 @@ const char kForceGoogleSafeSearch[] = "settings.force_google_safesearch"; ...@@ -914,10 +914,6 @@ const char kForceGoogleSafeSearch[] = "settings.force_google_safesearch";
// YouTube. See |safe_search_util::YouTubeRestrictMode| for possible values. // YouTube. See |safe_search_util::YouTubeRestrictMode| for possible values.
const char kForceYouTubeRestrict[] = "settings.force_youtube_restrict"; const char kForceYouTubeRestrict[] = "settings.force_youtube_restrict";
// Boolean controlling whether history is recorded via Session Sync
// (for supervised users).
const char kForceSessionSync[] = "settings.history_recorded";
// Comma separated list of domain names (e.g. "google.com,school.edu"). // Comma separated list of domain names (e.g. "google.com,school.edu").
// When this pref is set, the user will be able to access Google Apps // When this pref is set, the user will be able to access Google Apps
// only using an account that belongs to one of the domains from this pref. // only using an account that belongs to one of the domains from this pref.
......
...@@ -293,7 +293,6 @@ extern const char kMdHistoryMenuPromoShown[]; ...@@ -293,7 +293,6 @@ extern const char kMdHistoryMenuPromoShown[];
#endif #endif
extern const char kForceGoogleSafeSearch[]; extern const char kForceGoogleSafeSearch[];
extern const char kForceYouTubeRestrict[]; extern const char kForceYouTubeRestrict[];
extern const char kForceSessionSync[];
extern const char kAllowedDomainsForApps[]; extern const char kAllowedDomainsForApps[];
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
extern const char kUsesSystemTheme[]; extern const char kUsesSystemTheme[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment