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

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

Issue 3292003: De-suck the NTP a bit more: (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Fix unit test Created 10 years, 3 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/resources/new_new_tab.js ('k') | chrome/browser/resources/ntp/most_visited.js » ('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('recieved apps'); 6 logEvent('recieved apps');
7 var appsSection = $('apps-section'); 7 var appsSection = $('apps-section');
8 var appsSectionContent = $('apps-section-content'); 8 var appsSectionContent = $('apps-section-content');
9 var appsMiniview = appsSection.getElementsByClassName('miniview')[0]; 9 var appsMiniview = appsSection.getElementsByClassName('miniview')[0];
10 appsSectionContent.textContent = ''; 10 appsSectionContent.textContent = '';
11 appsMiniview.textContent = ''; 11 appsMiniview.textContent = '';
12 12
13 if (data.apps.length == 0) {
14 appsSection.classList.add('disabled');
15 return;
16 }
17
13 data.apps.forEach(function(app) { 18 data.apps.forEach(function(app) {
14 appsSectionContent.appendChild(apps.createElement(app)); 19 appsSectionContent.appendChild(apps.createElement(app));
15 }); 20 });
16 21
17 appsSectionContent.appendChild(apps.createWebStoreElement()); 22 appsSectionContent.appendChild(apps.createWebStoreElement());
18 23
19 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) { 24 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) {
20 appsMiniview.appendChild(apps.createMiniviewElement(app)); 25 appsMiniview.appendChild(apps.createMiniviewElement(app));
21 }); 26 });
22 27
28 appsSection.classList.remove('disabled');
23 layoutSections(); 29 layoutSections();
24 } 30 }
25 31
26 var apps = { 32 var apps = {
27 /** 33 /**
28 * @this {!HTMLAnchorElement} 34 * @this {!HTMLAnchorElement}
29 */ 35 */
30 handleClick_: function() { 36 handleClick_: function() {
31 var launchType = ''; 37 var launchType = '';
32 var inputElements = document.querySelectorAll( 38 var inputElements = document.querySelectorAll(
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 }, 140 },
135 141
136 createWebStoreElement: function() { 142 createWebStoreElement: function() {
137 return this.createElement_({ 143 return this.createElement_({
138 'id': 'web-store-entry', 144 'id': 'web-store-entry',
139 'name': localStrings.getString('web_store_title'), 145 'name': localStrings.getString('web_store_title'),
140 'launch_url': localStrings.getString('web_store_url') 146 'launch_url': localStrings.getString('web_store_url')
141 }); 147 });
142 } 148 }
143 }; 149 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/new_new_tab.js ('k') | chrome/browser/resources/ntp/most_visited.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698