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

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

Issue 3393013: Fix a bug where we would show both the apps and thumb sections (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: whoops Created 10 years, 3 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
diff --git a/chrome/browser/dom_ui/shown_sections_handler.cc b/chrome/browser/dom_ui/shown_sections_handler.cc
index 4af2d0be41efed343e223b8a9cd807904cf6ec88..78ff716bc882877ca02966022eee52cd0ccb35d2 100644
--- a/chrome/browser/dom_ui/shown_sections_handler.cc
+++ b/chrome/browser/dom_ui/shown_sections_handler.cc
@@ -23,8 +23,8 @@ namespace {
// was changed to hide/show the most visited thumbnails.
void NotifySectionDisabled(int new_mode, int old_mode, Profile *profile) {
// If the oldmode HAD either thumbs or lists visible.
- bool old_had_it = (old_mode & THUMB) || (old_mode & LIST);
- bool new_has_it = (new_mode & THUMB) || (new_mode & LIST);
+ bool old_had_it = old_mode & THUMB;
+ bool new_has_it = new_mode & THUMB;
if (old_had_it && !new_has_it) {
UserMetrics::RecordAction(
@@ -43,9 +43,7 @@ void NotifySectionDisabled(int new_mode, int old_mode, Profile *profile) {
// static
int ShownSectionsHandler::GetShownSections(PrefService* prefs) {
- int sections = prefs->GetInteger(prefs::kNTPShownSections);
- sections &= ~RECENT;
- return sections;
+ return prefs->GetInteger(prefs::kNTPShownSections);
}
ShownSectionsHandler::ShownSectionsHandler(PrefService* pref_service)
@@ -95,8 +93,7 @@ void ShownSectionsHandler::HandleSetShownSections(const ListValue* args) {
// static
void ShownSectionsHandler::RegisterUserPrefs(PrefService* pref_service) {
- pref_service->RegisterIntegerPref(prefs::kNTPShownSections,
- THUMB | RECENT | TIPS | SYNC | APPS);
+ pref_service->RegisterIntegerPref(prefs::kNTPShownSections, THUMB);
}
// static
@@ -106,17 +103,15 @@ void ShownSectionsHandler::MigrateUserPrefs(PrefService* pref_service,
bool changed = false;
int shown_sections = pref_service->GetInteger(prefs::kNTPShownSections);
- if (old_pref_version < 1) {
- // 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;
- changed = true;
- }
+ if (old_pref_version < 3) {
+ // In version 3, we went from being able to show multiple sections to being
+ // able to show only one expanded at a time. The only two expandable
+ // sections are APPS and THUMBS.
+ if (shown_sections & APPS)
+ shown_sections = APPS;
+ else
+ shown_sections = THUMB;
- if (old_pref_version < 2) {
- // LIST is no longer used. Change to THUMB.
- shown_sections &= ~LIST;
- shown_sections |= THUMB;
changed = true;
}
« 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