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

Unified Diff: chrome/browser/prefs/browser_prefs.cc

Issue 1295323002: Remove profile-based per-host & default zoom level migration code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/prefs/browser_prefs.cc
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index f092abcb7fd519db67a2b0b760026eb8362df931..f0d1f4ccbf468508312b3ecd815bd60a237b7d47 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -583,57 +583,4 @@ void MigrateObsoleteProfilePrefs(Profile* profile) {
#endif
}
gab 2015/08/18 20:39:40 https://codereview.chromium.org/541103002/diff/104
wjmaclean 2015/08/19 13:53:34 Sorry, forgot about that.
-// As part of the migration from per-profile to per-partition HostZoomMaps,
-// we need to detect if an existing per-profile set of preferences exist, and
-// if so convert them to be per-partition. We migrate any per-profile zoom
-// level prefs via zoom_level_prefs.
-// Code that updates zoom prefs in the profile prefs store has been removed,
-// so once we clear these values here, they should never get set again.
-// TODO(wjmaclean): Remove this migration machinery after histograms show
-// that an aceptable percentage of users have been migrated.
-// crbug.com/420643
-void MigrateProfileZoomLevelPrefs(Profile* profile) {
- PrefService* prefs = profile->GetPrefs();
- chrome::ChromeZoomLevelPrefs* zoom_level_prefs = profile->GetZoomLevelPrefs();
- DCHECK(zoom_level_prefs);
-
- bool migrated = false;
- // Only migrate the default zoom level if it is not equal to the registered
- // default for the preference.
- const base::Value* per_profile_default_zoom_level_value =
- prefs->GetUserPrefValue(prefs::kDefaultZoomLevelDeprecated);
- if (per_profile_default_zoom_level_value) {
- if (per_profile_default_zoom_level_value->GetType() ==
- base::Value::TYPE_DOUBLE) {
- double per_profile_default_zoom_level = 0.0;
- bool success = per_profile_default_zoom_level_value->GetAsDouble(
- &per_profile_default_zoom_level);
- DCHECK(success);
- zoom_level_prefs->SetDefaultZoomLevelPref(per_profile_default_zoom_level);
- }
- prefs->ClearPref(prefs::kDefaultZoomLevelDeprecated);
- migrated = true;
- }
-
- const base::DictionaryValue* host_zoom_dictionary =
- prefs->GetDictionary(prefs::kPerHostZoomLevelsDeprecated);
- // Collect stats on frequency with which migrations are occuring. This measure
- // is not perfect, since it will consider an un-migrated user with only
- // default value as being already migrated, but it will catch all non-trivial
- // migrations.
- migrated |= !host_zoom_dictionary->empty();
- UMA_HISTOGRAM_BOOLEAN("Settings.ZoomLevelPreferencesMigrated", migrated);
gab 2015/08/18 20:39:40 Also mark this histogram as obsolete.
wjmaclean 2015/08/19 13:53:34 Done. I didn't realize that histograms had an 'obs
-
- // Since |host_zoom_dictionary| is not partition-based, do not attempt to
- // sanitize it.
- zoom_level_prefs->ExtractPerHostZoomLevels(
- host_zoom_dictionary, false /* sanitize_partition_host_zoom_levels */);
-
- // We're done migrating the profile per-host zoom level values, so we clear
- // them all.
- DictionaryPrefUpdate host_zoom_dictionary_update(
- prefs, prefs::kPerHostZoomLevelsDeprecated);
- host_zoom_dictionary_update->Clear();
-}
-
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698