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

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

Issue 2714853002: Remove kDistroDict from Preferences. (Closed)
Patch Set: kRlzPingDelay -> kRlzPingDelaySeconds Created 3 years, 10 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 2f7ccb696098ecf766689e8fc515caf039eacc72..c48a4f450c465c4332024050e26665a296a1b53e 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -19,6 +19,7 @@
#include "chrome/installer/util/master_preferences_constants.h"
#include "chrome/installer/util/util_constants.h"
#include "components/variations/pref_names.h"
+#include "rlz/features/features.h"
namespace {
@@ -207,17 +208,32 @@ bool MasterPreferences::InitializeFromString(const std::string& json_data) {
}
void MasterPreferences::EnforceLegacyPreferences() {
+ // Boolean. This is a legacy preference and should no longer be used; it is
+ // kept around so that old master_preferences which specify
+ // "create_all_shortcuts":false still enforce the new
+ // "do_not_create_(desktop|quick_launch)_shortcut" preferences. Setting this
+ // to true no longer has any impact.
+ static constexpr char kCreateAllShortcuts[] = "create_all_shortcuts";
+
// If create_all_shortcuts was explicitly set to false, set
// do_not_create_(desktop|quick_launch)_shortcut to true.
bool create_all_shortcuts = true;
- GetBool(installer::master_preferences::kCreateAllShortcuts,
- &create_all_shortcuts);
+ GetBool(kCreateAllShortcuts, &create_all_shortcuts);
if (!create_all_shortcuts) {
distribution_->SetBoolean(
installer::master_preferences::kDoNotCreateDesktopShortcut, true);
distribution_->SetBoolean(
installer::master_preferences::kDoNotCreateQuickLaunchShortcut, true);
}
+
+#if BUILDFLAG(ENABLE_RLZ)
+ // Map the RLZ ping delay shipped in the distribution dictionary into real
+ // prefs.
+ static constexpr char kDistroPingDelay[] = "ping_delay";
+ int rlz_ping_delay = 0;
+ if (GetInt(kDistroPingDelay, &rlz_ping_delay))
+ master_dictionary_->SetInteger(prefs::kRlzPingDelaySeconds, rlz_ping_delay);
+#endif // BUILDFLAG(ENABLE_RLZ)
}
bool MasterPreferences::GetBool(const std::string& name, bool* value) const {
« 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