| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } else { | 71 } else { |
| 72 appsSection.classList.remove('disabled'); | 72 appsSection.classList.remove('disabled'); |
| 73 } | 73 } |
| 74 addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS); | 74 addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS); |
| 75 | 75 |
| 76 apps.loaded = true; | 76 apps.loaded = true; |
| 77 if (apps.showPromo) | 77 if (apps.showPromo) |
| 78 document.documentElement.classList.add('apps-promo-visible'); | 78 document.documentElement.classList.add('apps-promo-visible'); |
| 79 else | 79 else |
| 80 document.documentElement.classList.remove('apps-promo-visible'); | 80 document.documentElement.classList.remove('apps-promo-visible'); |
| 81 $('apps-promo-link').setAttribute('ping', appsPromoPing); | 81 |
| 82 var appsPromoLink = $('apps-promo-link'); |
| 83 if (appsPromoLink) |
| 84 appsPromoLink.setAttribute('ping', appsPromoPing); |
| 82 maybeDoneLoading(); | 85 maybeDoneLoading(); |
| 83 | 86 |
| 84 if (isDoneLoading()) { | 87 if (isDoneLoading()) { |
| 85 if (!apps.showPromo && data.apps.length >= MAX_APPS_PER_ROW[layoutMode]) | 88 if (!apps.showPromo && data.apps.length >= MAX_APPS_PER_ROW[layoutMode]) |
| 86 webStoreEntry.classList.add('loner'); | 89 webStoreEntry.classList.add('loner'); |
| 87 else | 90 else |
| 88 webStoreEntry.classList.remove('loner'); | 91 webStoreEntry.classList.remove('loner'); |
| 89 | 92 |
| 90 updateMiniviewClipping(appsMiniview); | 93 updateMiniviewClipping(appsMiniview); |
| 91 layoutSections(); | 94 layoutSections(); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 createWebStoreClosedMenuElement: function() { | 357 createWebStoreClosedMenuElement: function() { |
| 355 var a = document.createElement('a'); | 358 var a = document.createElement('a'); |
| 356 a.textContent = localStrings.getString('web_store_title'); | 359 a.textContent = localStrings.getString('web_store_title'); |
| 357 a.href = localStrings.getString('web_store_url'); | 360 a.href = localStrings.getString('web_store_url'); |
| 358 a.style.backgroundImage = url('chrome://theme/IDR_PRODUCT_LOGO_16'); | 361 a.style.backgroundImage = url('chrome://theme/IDR_PRODUCT_LOGO_16'); |
| 359 a.className = 'item'; | 362 a.className = 'item'; |
| 360 return a; | 363 return a; |
| 361 } | 364 } |
| 362 }; | 365 }; |
| 363 })(); | 366 })(); |
| OLD | NEW |