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

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

Issue 337011: NTP: Allow hiding tips and bookmark sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/dom_ui/shown_sections_handler.cc
===================================================================
--- chrome/browser/dom_ui/shown_sections_handler.cc (revision 30053)
+++ chrome/browser/dom_ui/shown_sections_handler.cc (working copy)
@@ -47,6 +47,18 @@
// static
void ShownSectionsHandler::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterIntegerPref(prefs::kNTPShownSections,
- THUMB | RECENT | TIPS);
+ THUMB | RECENT | TIPS | SYNC);
}
+// static
+void ShownSectionsHandler::MigrateUserPrefs(PrefService* prefs,
+ int old_pref_version,
+ int new_pref_version) {
+ if (old_pref_version < 1) {
+ int shown_sections = prefs->GetInteger(prefs::kNTPShownSections);
+ // TIPS was used in early builds of the NNTP but since it was removed before
+ // Chrome 3.0 we want to ensure that it is shown by default.
+ shown_sections |= TIPS | SYNC;
+ prefs->SetInteger(prefs::kNTPShownSections, shown_sections);
+ }
+}
« no previous file with comments | « chrome/browser/dom_ui/shown_sections_handler.h ('k') | chrome/browser/dom_ui/shown_sections_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698