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

Unified Diff: chrome/installer/util/master_preferences.cc

Issue 2705113005: Update AutoImport to import nothing by default (in absence of policy and master_prefs). (Closed)
Patch Set: update comment in chrome_browser_main.cc Created 3 years, 9 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
« no previous file with comments | « chrome/installer/util/master_preferences.h ('k') | chrome/installer/util/master_preferences_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/master_preferences.cc
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index fa014177d8bafcabf091067ad029f6a4e9e87633..223aa320065ed7e21a75fa02eccc24cefa8d1d8f 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -226,6 +226,29 @@ void MasterPreferences::EnforceLegacyPreferences() {
installer::master_preferences::kDoNotCreateQuickLaunchShortcut, true);
}
+ // Deprecated boolean import master preferences now mapped to their duplicates
+ // in prefs::.
+ static constexpr char kDistroImportHistoryPref[] = "import_history";
+ static constexpr char kDistroImportHomePagePref[] = "import_home_page";
+ static constexpr char kDistroImportSearchPref[] = "import_search_engine";
+ static constexpr char kDistroImportBookmarksPref[] = "import_bookmarks";
+
+ static constexpr struct {
+ const char* old_distro_pref_path;
+ const char* modern_pref_path;
+ } kLegacyDistroImportPrefMappings[] = {
+ {kDistroImportBookmarksPref, prefs::kImportBookmarks},
+ {kDistroImportHistoryPref, prefs::kImportHistory},
+ {kDistroImportHomePagePref, prefs::kImportHomepage},
+ {kDistroImportSearchPref, prefs::kImportSearchEngine},
+ };
+
+ for (const auto& mapping : kLegacyDistroImportPrefMappings) {
+ bool value = false;
+ if (GetBool(mapping.old_distro_pref_path, &value))
+ master_dictionary_->SetBoolean(mapping.modern_pref_path, value);
+ }
+
#if BUILDFLAG(ENABLE_RLZ)
// Map the RLZ ping delay shipped in the distribution dictionary into real
// prefs.
« no previous file with comments | « chrome/installer/util/master_preferences.h ('k') | chrome/installer/util/master_preferences_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698