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

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: Fixing clang compile Created 9 years 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 var pageNames = data.appPageNames; 272 var pageNames = data.appPageNames;
273 273
274 function stringListIsEmpty(list) { 274 function stringListIsEmpty(list) {
275 for (var i = 0; i < list.length; i++) { 275 for (var i = 0; i < list.length; i++) {
276 if (list[i]) 276 if (list[i])
277 return false; 277 return false;
278 } 278 }
279 return true; 279 return true;
280 } 280 }
281 281
282 // Sort by launch index 282 // Sort by launch ordinal
283 apps.sort(function(a, b) { 283 apps.sort(function(a, b) {
284 return a.app_launch_index - b.app_launch_index; 284 return a.app_launch_ordinal > b.app_launch_ordinal;
285 }); 285 });
286 286
287 // An app to animate (in case it was just installed). 287 // An app to animate (in case it was just installed).
288 var highlightApp; 288 var highlightApp;
289 289
290 // Add the apps, creating pages as necessary 290 // Add the apps, creating pages as necessary
291 for (var i = 0; i < apps.length; i++) { 291 for (var i = 0; i < apps.length; i++) {
292 var app = apps[i]; 292 var app = apps[i];
293 var pageIndex = app.page_index || 0; 293 var pageIndex = app.page_index || 0;
294 while (pageIndex >= this.appsPages.length) { 294 while (pageIndex >= this.appsPages.length) {
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 this.cardSlider.selectCard(cardIndex, true); 587 this.cardSlider.selectCard(cardIndex, true);
588 588
589 e.stopPropagation(); 589 e.stopPropagation();
590 } 590 }
591 }; 591 };
592 592
593 return { 593 return {
594 PageListView: PageListView 594 PageListView: PageListView
595 }; 595 };
596 }); 596 });
OLDNEW
« no previous file with comments | « chrome/browser/extensions/unpacked_installer.cc ('k') | chrome/browser/sync/test/integration/sync_extension_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698