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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 7717012: ntp4: default to 18 apps per page for new installs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove checks Created 9 years, 4 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/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 53c68cf8f26dfb7e8275ee04e5dd6694acd457dc..157c020ff70c32ac07967d48387ddc49edab2d9a 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -162,10 +162,14 @@ void AppLauncherHandler::CreateAppInfo(const Extension* extension,
value->SetInteger("app_launch_index", app_launch_index);
int page_index = prefs->GetPageIndex(extension->id());
- if (page_index >= 0) {
- // Only provide a value if one is stored
- value->SetInteger("page_index", page_index);
- }
+ if (page_index < 0) {
+ // Make sure every app has a page index (some predate the page index).
+ // The webstore app should be on the first page.
+ page_index = extension->id() == extension_misc::kWebStoreAppId ?
+ 0 : prefs->GetNaturalAppPageIndex();
+ prefs->SetPageIndex(extension->id(), page_index);
+ }
+ value->SetInteger("page_index", page_index);
}
// TODO(estade): remove this. We record app launches via js calls rather than

Powered by Google App Engine
This is Rietveld 408576698