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

Unified Diff: chrome/browser/dom_ui/shown_sections_handler.cc

Issue 5494001: Skip migrating for default shown sections prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/shown_sections_handler.cc
diff --git a/chrome/browser/dom_ui/shown_sections_handler.cc b/chrome/browser/dom_ui/shown_sections_handler.cc
index 52d3ae644ea1c2a26687a3b79840f445fda2ce0d..04d956437524437b11909ba4bb86cecee8327ea9 100644
--- a/chrome/browser/dom_ui/shown_sections_handler.cc
+++ b/chrome/browser/dom_ui/shown_sections_handler.cc
@@ -106,6 +106,12 @@ void ShownSectionsHandler::RegisterUserPrefs(PrefService* pref_service) {
void ShownSectionsHandler::MigrateUserPrefs(PrefService* pref_service,
int old_pref_version,
int new_pref_version) {
+ // Nothing to migrate for default kNTPShownSections value.
+ const PrefService::Preference* shown_sections_pref =
+ pref_service->FindPreference(prefs::kNTPShownSections);
+ if (shown_sections_pref->IsDefaultValue())
+ return;
+
bool changed = false;
int shown_sections = pref_service->GetInteger(prefs::kNTPShownSections);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698