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 var MAX_APPS_PER_ROW = []; | 5 var MAX_APPS_PER_ROW = []; |
6 MAX_APPS_PER_ROW[LayoutMode.SMALL] = 4; | 6 MAX_APPS_PER_ROW[LayoutMode.SMALL] = 4; |
7 MAX_APPS_PER_ROW[LayoutMode.NORMAL] = 6; | 7 MAX_APPS_PER_ROW[LayoutMode.NORMAL] = 6; |
8 | 8 |
9 // The URL prefix used in the app link 'ping' attributes. | 9 // The URL prefix used in the app link 'ping' attributes. |
10 var PING_APP_LAUNCH_PREFIX = 'record-app-launch'; | 10 var PING_APP_LAUNCH_PREFIX = 'record-app-launch'; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 addClosedMenuEntryWithLink(apps.menu, apps.createClosedMenuElement(app)); | 58 addClosedMenuEntryWithLink(apps.menu, apps.createClosedMenuElement(app)); |
59 }); | 59 }); |
60 if (data.apps.length < MAX_MINIVIEW_ITEMS) { | 60 if (data.apps.length < MAX_MINIVIEW_ITEMS) { |
61 webStoreMiniEntry = apps.createWebStoreMiniElement(); | 61 webStoreMiniEntry = apps.createWebStoreMiniElement(); |
62 webStoreEntry.querySelector('a').setAttribute('ping', appsPromoPing); | 62 webStoreEntry.querySelector('a').setAttribute('ping', appsPromoPing); |
63 appsMiniview.appendChild(webStoreMiniEntry); | 63 appsMiniview.appendChild(webStoreMiniEntry); |
64 addClosedMenuEntryWithLink(apps.menu, | 64 addClosedMenuEntryWithLink(apps.menu, |
65 apps.createWebStoreClosedMenuElement()); | 65 apps.createWebStoreClosedMenuElement()); |
66 } | 66 } |
67 | 67 |
68 if (!(shownSections & MINIMIZED_APPS)) { | 68 if (!data.showLauncher || (shownSections & MINIMIZED_APPS)) { |
| 69 appsSection.classList.add('disabled'); |
| 70 } else { |
69 appsSection.classList.remove('disabled'); | 71 appsSection.classList.remove('disabled'); |
70 } | 72 } |
71 addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS); | 73 addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS); |
72 | 74 |
73 apps.loaded = true; | 75 apps.loaded = true; |
74 if (apps.showPromo) | 76 if (apps.showPromo) |
75 document.documentElement.classList.add('apps-promo-visible'); | 77 document.documentElement.classList.add('apps-promo-visible'); |
76 else | 78 else |
77 document.documentElement.classList.remove('apps-promo-visible'); | 79 document.documentElement.classList.remove('apps-promo-visible'); |
78 $('apps-promo-link').setAttribute('ping', appsPromoPing); | 80 $('apps-promo-link').setAttribute('ping', appsPromoPing); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 createWebStoreClosedMenuElement: function() { | 353 createWebStoreClosedMenuElement: function() { |
352 var a = document.createElement('a'); | 354 var a = document.createElement('a'); |
353 a.textContent = localStrings.getString('web_store_title'); | 355 a.textContent = localStrings.getString('web_store_title'); |
354 a.href = localStrings.getString('web_store_url'); | 356 a.href = localStrings.getString('web_store_url'); |
355 a.style.backgroundImage = url('chrome://theme/IDR_PRODUCT_LOGO_16'); | 357 a.style.backgroundImage = url('chrome://theme/IDR_PRODUCT_LOGO_16'); |
356 a.className = 'item'; | 358 a.className = 'item'; |
357 return a; | 359 return a; |
358 } | 360 } |
359 }; | 361 }; |
360 })(); | 362 })(); |
OLD | NEW |