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

Unified Diff: chrome/browser/resources/ntp4/new_tab.js

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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/new_tab.js
diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js
index 8fe74c5922ae4814f9b01bbd88f70a618a4cd0ec..904a5977b92c7780bc15f62a5682f7274196ec7c 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -314,9 +314,6 @@ cr.define('ntp4', function() {
return true;
}
- if (!pageNames || stringListIsEmpty(pageNames))
- pageNames = [localStrings.getString('appDefaultPageName')];
-
// Sort by launch index
apps.sort(function(a, b) {
return a.app_launch_index - b.app_launch_index;
@@ -330,7 +327,7 @@ cr.define('ntp4', function() {
var app = apps[i];
var pageIndex = (app.page_index || 0);
while (pageIndex >= appsPages.length) {
- var pageName = '';
+ var pageName = localStrings.getString('appDefaultPageName');
if (appsPages.length < pageNames.length)
pageName = pageNames[appsPages.length];
@@ -378,7 +375,9 @@ cr.define('ntp4', function() {
if (pageIndex >= appsPages.length) {
while (pageIndex >= appsPages.length) {
- appendTilePage(new ntp4.AppsPage(), '', true, bookmarksPage);
+ appendTilePage(new ntp4.AppsPage(),
+ localStrings.getString('appDefaultPageName'), true,
+ bookmarksPage);
}
updateSliderCards();
}
@@ -441,7 +440,7 @@ cr.define('ntp4', function() {
var dots = dotList.getElementsByClassName('dot');
// TODO(csilv): Remove this calcluation if/when we remove the flag for
// for the bookmarks page.
- var length = bookmarksPage ? dots.length - 2 : dots.Length - 1;
+ var length = bookmarksPage ? dots.length - 1 : dots.length;
for (var i = 1; i < length; ++i) {
dots[i].displayTitle = data.appPageNames[i - 1] || '';
}
@@ -542,7 +541,8 @@ cr.define('ntp4', function() {
function enterRearrangeMode() {
var tempPage = new ntp4.AppsPage();
tempPage.classList.add('temporary');
- appendTilePage(tempPage, '', true, bookmarksPage);
+ appendTilePage(tempPage, localStrings.getString('appDefaultPageName'),
+ true, bookmarksPage);
var tempIndex = Array.prototype.indexOf.call(tilePages, tempPage);
if (cardSlider.currentCard >= tempIndex)
cardSlider.currentCard += 1;
@@ -568,7 +568,7 @@ cr.define('ntp4', function() {
updateSliderCards();
} else {
tempPage.classList.remove('temporary');
- saveAppPageName(tempPage, '');
+ saveAppPageName(tempPage, localStrings.getString('appDefaultPageName'));
Dan Beam 2011/10/14 08:19:56 Might it make sense to keep one central var app
}
$('footer').classList.remove('showing-trash-mode');
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698