diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 19:52:31 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 19:52:31 +0000 |
commit | d44e998f1bd4adf7b4cfa513fa4e8f5972056ab0 (patch) | |
tree | 4a702c7c880531cbdac99f17ffd93c6865b89462 /chrome/browser/dom_ui/shown_sections_handler.cc | |
parent | 2c1d273765f1cc433555e68b129f03e8575d3f16 (diff) | |
download | chromium_src-d44e998f1bd4adf7b4cfa513fa4e8f5972056ab0.zip chromium_src-d44e998f1bd4adf7b4cfa513fa4e8f5972056ab0.tar.gz chromium_src-d44e998f1bd4adf7b4cfa513fa4e8f5972056ab0.tar.bz2 |
NTP: Allow hiding tips and bookmark sync.
This change adds 2 new menu items to the option menu.
There is pref migration code to make tips and sync visible by default.
BUG=24319
TEST=Hide and show the different sections and reload to make sure it
is persisted across instances of NTP.
Review URL: http://codereview.chromium.org/337011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/shown_sections_handler.cc')
-rw-r--r-- | chrome/browser/dom_ui/shown_sections_handler.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/dom_ui/shown_sections_handler.cc b/chrome/browser/dom_ui/shown_sections_handler.cc index ad05112..d6769b3 100644 --- a/chrome/browser/dom_ui/shown_sections_handler.cc +++ b/chrome/browser/dom_ui/shown_sections_handler.cc @@ -47,6 +47,18 @@ void ShownSectionsHandler::HandleSetShownSections(const Value* value) { // 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); + } +} |