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

Side by Side Diff: chrome/browser/resources/ntp4/page_list_view.js

Issue 8198003: Convert app_launch_index and page_index from int to StringOrdinal. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressing review comments Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview PageListView implementation. 6 * @fileoverview PageListView implementation.
7 * PageListView manages page list, dot list, switcher buttons and handles apps 7 * PageListView manages page list, dot list, switcher buttons and handles apps
8 * pages callbacks from backend. 8 * pages callbacks from backend.
9 * 9 *
10 * Note that you need to have AppLauncherHandler in your WebUI to use this code. 10 * Note that you need to have AppLauncherHandler in your WebUI to use this code.
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 function stringListIsEmpty(list) { 288 function stringListIsEmpty(list) {
289 for (var i = 0; i < list.length; i++) { 289 for (var i = 0; i < list.length; i++) {
290 if (list[i]) 290 if (list[i])
291 return false; 291 return false;
292 } 292 }
293 return true; 293 return true;
294 } 294 }
295 295
296 // Sort by launch index 296 // Sort by launch index
297 apps.sort(function(a, b) { 297 apps.sort(function(a, b) {
298 return a.app_launch_index - b.app_launch_index; 298 return a.app_launch_index > b.app_launch_index;
299 }); 299 });
300 300
301 // An app to animate (in case it was just installed). 301 // An app to animate (in case it was just installed).
302 var highlightApp; 302 var highlightApp;
303 303
304 // Add the apps, creating pages as necessary 304 // Add the apps, creating pages as necessary
305 for (var i = 0; i < apps.length; i++) { 305 for (var i = 0; i < apps.length; i++) {
306 var app = apps[i]; 306 var app = apps[i];
307 var pageIndex = app.page_index || 0; 307 var pageIndex = app.page_index || 0;
308 while (pageIndex >= this.appsPages.length) { 308 while (pageIndex >= this.appsPages.length) {
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 this.cardSlider.selectCard(cardIndex, true); 613 this.cardSlider.selectCard(cardIndex, true);
614 614
615 e.stopPropagation(); 615 e.stopPropagation();
616 } 616 }
617 }; 617 };
618 618
619 return { 619 return {
620 PageListView: PageListView 620 PageListView: PageListView
621 }; 621 };
622 }); 622 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698