OLD | NEW |
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 Loading... |
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 Loading... |
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 })(); |
OLD | NEW |