OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // To avoid creating tons of unnecessary nodes. We assume we cannot fit more | 5 // To avoid creating tons of unnecessary nodes. We assume we cannot fit more |
6 // than this many items in the miniview. | 6 // than this many items in the miniview. |
7 var MAX_MINIVIEW_ITEMS = 15; | 7 var MAX_MINIVIEW_ITEMS = 15; |
8 | 8 |
9 // Extra spacing at the top of the layout. | 9 // Extra spacing at the top of the layout. |
10 var LAYOUT_SPACING_TOP = 25; | 10 var LAYOUT_SPACING_TOP = 25; |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 } | 1020 } |
1021 | 1021 |
1022 function doAction() { | 1022 function doAction() { |
1023 f(); | 1023 f(); |
1024 closeNotification(); | 1024 closeNotification(); |
1025 } | 1025 } |
1026 | 1026 |
1027 function closeNotification() { | 1027 function closeNotification() { |
1028 if (notification.classList.contains('promo')) | 1028 if (notification.classList.contains('promo')) |
1029 chrome.send('closePromo'); | 1029 chrome.send('closePromo'); |
1030 } | |
1031 hideNotification(); | 1030 hideNotification(); |
1032 } | 1031 } |
1033 | 1032 |
1034 // Remove classList entries from previous notifications. | 1033 // Remove classList entries from previous notifications. |
1035 notification.classList.remove('first-run'); | 1034 notification.classList.remove('first-run'); |
1036 notification.classList.remove('promo'); | 1035 notification.classList.remove('promo'); |
1037 | 1036 |
1038 var messageContainer = notificationElement.firstElementChild; | 1037 var messageContainer = notificationElement.firstElementChild; |
1039 var actionLink = notificationElement.querySelector('#action-link'); | 1038 var actionLink = notificationElement.querySelector('#action-link'); |
1040 var closeButton = notificationElement.querySelector('#notification-close'); | 1039 var closeButton = notificationElement.querySelector('#notification-close'); |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 | 1480 |
1482 // Initialize the listener for the "hide this" link on the apps promo. We do | 1481 // Initialize the listener for the "hide this" link on the apps promo. We do |
1483 // this outside of getAppsCallback because it only needs to be done once per | 1482 // this outside of getAppsCallback because it only needs to be done once per |
1484 // NTP load. | 1483 // NTP load. |
1485 $('apps-promo-hide').addEventListener('click', function() { | 1484 $('apps-promo-hide').addEventListener('click', function() { |
1486 chrome.send('hideAppsPromo', []); | 1485 chrome.send('hideAppsPromo', []); |
1487 document.documentElement.classList.remove('apps-promo-visible'); | 1486 document.documentElement.classList.remove('apps-promo-visible'); |
1488 layoutSections(); | 1487 layoutSections(); |
1489 }); | 1488 }); |
1490 }); | 1489 }); |
OLD | NEW |