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

Side by Side Diff: chrome/browser/resources/ntp/apps.js

Issue 3808009: Adds --enable-app-launcher command line switch (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: renamed a variable Created 10 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/dom_ui/app_launcher_handler.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 function getAppsCallback(data) { 5 function getAppsCallback(data) {
6 logEvent('received apps'); 6 logEvent('received apps');
7 var appsSection = $('apps'); 7 var appsSection = $('apps');
8 var appsSectionContent = $('apps-maxiview'); 8 var appsSectionContent = $('apps-maxiview');
9 var appsMiniview = appsSection.getElementsByClassName('miniview')[0]; 9 var appsMiniview = appsSection.getElementsByClassName('miniview')[0];
10 var appsPromo = $('apps-promo'); 10 var appsPromo = $('apps-promo');
11 11
12 appsMiniview.textContent = ''; 12 appsMiniview.textContent = '';
13 while (appsSectionContent.lastChild != appsPromo) { 13 while (appsSectionContent.lastChild != appsPromo) {
14 appsSectionContent.removeChild(appsSectionContent.lastChild); 14 appsSectionContent.removeChild(appsSectionContent.lastChild);
15 } 15 }
16 16
17 data.apps.sort(function(a,b) { 17 data.apps.sort(function(a,b) {
18 return a.app_launch_index - b.app_launch_index 18 return a.app_launch_index - b.app_launch_index
19 }); 19 });
20 20
21 clearClosedMenu(apps.menu); 21 clearClosedMenu(apps.menu);
22 if (data.apps.length == 0) { 22 if (data.apps.length == 0 && !data.showLauncher) {
23 appsSection.classList.add('disabled'); 23 appsSection.classList.add('disabled');
24 layoutSections(); 24 layoutSections();
25 } else { 25 } else {
26 data.apps.forEach(function(app) { 26 data.apps.forEach(function(app) {
27 appsSectionContent.appendChild(apps.createElement(app)); 27 appsSectionContent.appendChild(apps.createElement(app));
28 }); 28 });
29 29
30 appsSectionContent.appendChild(apps.createWebStoreElement()); 30 appsSectionContent.appendChild(apps.createWebStoreElement());
31 31
32 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) { 32 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 var elm = createElement({ 290 var elm = createElement({
291 'id': 'web-store-entry', 291 'id': 'web-store-entry',
292 'name': localStrings.getString('web_store_title'), 292 'name': localStrings.getString('web_store_title'),
293 'launch_url': localStrings.getString('web_store_url') 293 'launch_url': localStrings.getString('web_store_url')
294 }); 294 });
295 elm.setAttribute('app-id', 'web-store-entry'); 295 elm.setAttribute('app-id', 'web-store-entry');
296 return elm; 296 return elm;
297 } 297 }
298 }; 298 };
299 })(); 299 })();
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/app_launcher_handler.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698