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

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

Issue 8264001: ntp4: apps apps apps... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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/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 f3c7a10d1b597e87aa0ed8281b02c573d4ee2263..f1e764ee2e237c876f9565daa0a191ae69f372d9 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -48,6 +48,7 @@
#include "grit/generated_resources.h"
#include "net/base/escape.h"
#include "ui/base/animation/animation.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/codec/png_codec.h"
#include "webkit/glue/window_open_disposition.h"
@@ -449,7 +450,14 @@ void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) {
if (NewTabUI::NTP4Enabled()) {
PrefService* prefs = Profile::FromWebUI(web_ui_)->GetPrefs();
const ListValue* app_page_names = prefs->GetList(prefs::kNTPAppPageNames);
- if (app_page_names && app_page_names->GetSize()) {
+ if (!app_page_names || !app_page_names->GetSize()) {
+ ListPrefUpdate update(prefs, prefs::kNTPAppPageNames);
+ ListValue* list = update.Get();
+ list->Set(0, Value::CreateStringValue(
+ l10n_util::GetStringUTF16(IDS_APP_DEFAULT_PAGE_NAME)));
+ dictionary->Set("appPageNames",
+ static_cast<ListValue*>(list->DeepCopy()));
+ } else {
dictionary->Set("appPageNames",
static_cast<ListValue*>(app_page_names->DeepCopy()));
}
« chrome/browser/resources/ntp4/new_tab.js ('K') | « chrome/browser/resources/ntp4/new_tab.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698