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

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

Issue 3522015: Implement new strategy for default apps (Closed)
Patch Set: all done 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/resources/ntp/apps.css ('k') | chrome/browser/shell_integration.cc » ('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');
(...skipping 19 matching lines...) Expand all
30 addClosedMenuEntryWithLink(apps.menu, apps.createClosedMenuElement(app)); 30 addClosedMenuEntryWithLink(apps.menu, apps.createClosedMenuElement(app));
31 }); 31 });
32 32
33 if (!(shownSections & MINIMIZED_APPS)) { 33 if (!(shownSections & MINIMIZED_APPS)) {
34 appsSection.classList.remove('disabled'); 34 appsSection.classList.remove('disabled');
35 } 35 }
36 } 36 }
37 addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS); 37 addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS);
38 38
39 apps.loaded = true; 39 apps.loaded = true;
40 if (data.showPromo)
41 document.documentElement.classList.add('apps-promo-visible');
42 else
43 document.documentElement.classList.remove('apps-promo-visible');
40 maybeDoneLoading(); 44 maybeDoneLoading();
41 45
42 if (data.apps.length > 0 && isDoneLoading()) { 46 if (data.apps.length > 0 && isDoneLoading()) {
43 updateMiniviewClipping(appsMiniview); 47 updateMiniviewClipping(appsMiniview);
44 layoutSections(); 48 layoutSections();
45 } 49 }
46 } 50 }
47 51
48 function appsPrefChangeCallback(data) { 52 function appsPrefChangeCallback(data) {
49 // Currently the only pref that is watched is the launch type. 53 // Currently the only pref that is watched is the launch type.
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 var elm = createElement({ 286 var elm = createElement({
283 'id': 'web-store-entry', 287 'id': 'web-store-entry',
284 'name': localStrings.getString('web_store_title'), 288 'name': localStrings.getString('web_store_title'),
285 'launch_url': localStrings.getString('web_store_url') 289 'launch_url': localStrings.getString('web_store_url')
286 }); 290 });
287 elm.setAttribute('app-id', 'web-store-entry'); 291 elm.setAttribute('app-id', 'web-store-entry');
288 return elm; 292 return elm;
289 } 293 }
290 }; 294 };
291 })(); 295 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp/apps.css ('k') | chrome/browser/shell_integration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698