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

Side by Side Diff: chrome/browser/resources/ntp_search/new_tab.js

Issue 11412214: NTP5: Fine tuning of Apps implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 New tab page 6 * @fileoverview New tab page
7 * This is the main code for the new tab page. NewTabView manages page list, 7 * This is the main code for the new tab page. NewTabView manages page list,
8 * dot list and handles apps pages callbacks from backend. It also handles 8 * dot list and handles apps pages callbacks from backend. It also handles
9 * the layout of the Bottom Panel and the global UI states of the New Tab Page. 9 * the layout of the Bottom Panel and the global UI states of the New Tab Page.
10 */ 10 */
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 var startTime = Date.now(); 407 var startTime = Date.now();
408 408
409 if (page) 409 if (page)
410 page.removeAllTiles(); 410 page.removeAllTiles();
411 411
412 // Get the array of apps and add any special synthesized entries 412 // Get the array of apps and add any special synthesized entries
413 var apps = data.apps; 413 var apps = data.apps;
414 414
415 // Sort by launch ordinal 415 // Sort by launch ordinal
416 apps.sort(function(a, b) { 416 apps.sort(function(a, b) {
417 return a.app_launch_ordinal > b.app_launch_ordinal ? 1 : 417 return a.title.toLocaleLowerCase() > b.title.toLocaleLowerCase() ? 1 :
418 a.app_launch_ordinal < b.app_launch_ordinal ? -1 : 0; 418 a.title.toLocaleLowerCase() < b.title.toLocaleLowerCase() ? -1 : 0;
419 }); 419 });
420 420
421 // An app to animate (in case it was just installed). 421 // An app to animate (in case it was just installed).
422 var highlightApp; 422 var highlightApp;
423 423
424 // Add the apps, creating pages as necessary 424 // Add the apps, creating pages as necessary
425 this.appendTilePage(new ntp.AppsPage(), 425 this.appendTilePage(new ntp.AppsPage(),
426 loadTimeData.getString('appDefaultPageName')); 426 loadTimeData.getString('appDefaultPageName'));
427 for (var i = 0; i < apps.length; i++) { 427 for (var i = 0; i < apps.length; i++) {
428 var app = apps[i]; 428 var app = apps[i];
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 setMostVisitedPages: setMostVisitedPages, 1059 setMostVisitedPages: setMostVisitedPages,
1060 setRecentlyClosedTabs: setRecentlyClosedTabs, 1060 setRecentlyClosedTabs: setRecentlyClosedTabs,
1061 showNotification: showNotification, 1061 showNotification: showNotification,
1062 themeChanged: themeChanged, 1062 themeChanged: themeChanged,
1063 }; 1063 };
1064 }); 1064 });
1065 1065
1066 document.addEventListener('DOMContentLoaded', ntp.onLoad); 1066 document.addEventListener('DOMContentLoaded', ntp.onLoad);
1067 1067
1068 var toCssPx = cr.ui.toCssPx; 1068 var toCssPx = cr.ui.toCssPx;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698