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

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

Issue 3156049: First set of changes for M7 NTP. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: pre-review cleanup Created 10 years, 4 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
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 debugSection = $('debug'); 8 var appsSectionContent = $('apps-section-content');
9 appsSection.textContent = ''; 9 appsSectionContent.textContent = '';
10 10
11 data.apps.forEach(function(app) { 11 data.apps.forEach(function(app) {
12 appsSection.appendChild(apps.createElement(app)); 12 appsSectionContent.appendChild(apps.createElement(app));
13 }); 13 });
14 14
15 // TODO(aa): Figure out what to do with the debug mode when we turn apps on 15 appsSectionContent.appendChild(apps.createWebStoreElement());
16 // for everyone.
17 if (appsSection.hasChildNodes()) {
18 appsSection.classList.remove('disabled');
19 if (data.showDebugLink) {
20 debugSection.classList.remove('disabled');
21 }
22
23 appsSection.appendChild(apps.createWebStoreElement());
24 } else {
25 appsSection.classList.add('disabled');
26 debugSection.classList.add('disabled');
27 }
28 } 16 }
29 17
30 var apps = { 18 var apps = {
31 /** 19 /**
32 * @this {!HTMLAnchorElement} 20 * @this {!HTMLAnchorElement}
33 */ 21 */
34 handleClick_: function() { 22 handleClick_: function() {
35 var launchType = ''; 23 var launchType = '';
36 var inputElements = document.querySelectorAll( 24 var inputElements = document.querySelectorAll(
37 '#apps-launch-control input'); 25 '#apps-launch-control input');
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 }, 112 },
125 113
126 createWebStoreElement: function() { 114 createWebStoreElement: function() {
127 return this.createElement_({ 115 return this.createElement_({
128 'id': 'web-store-entry', 116 'id': 'web-store-entry',
129 'name': localStrings.getString('web_store_title'), 117 'name': localStrings.getString('web_store_title'),
130 'launch_url': localStrings.getString('web_store_url') 118 'launch_url': localStrings.getString('web_store_url')
131 }); 119 });
132 } 120 }
133 }; 121 };
OLDNEW
« chrome/browser/resources/ntp/apps.css ('K') | « chrome/browser/resources/ntp/apps.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698