Chromium Code Reviews| 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'); |