Index: chrome/browser/resources/new_new_tab.js |
=================================================================== |
--- chrome/browser/resources/new_new_tab.js (revision 67122) |
+++ chrome/browser/resources/new_new_tab.js (working copy) |
@@ -814,11 +814,16 @@ |
hideNotification(); |
} |
- // Remove any possible first-run trails. |
+ // Remove classList entries from previous notifications. |
notification.classList.remove('first-run'); |
+ notification.classList.remove('promo'); |
+ var notificationNode = notificationElement.firstElementChild; |
+ notificationNode.removeChild(notificationNode.firstChild); |
+ |
var actionLink = notificationElement.querySelector('.link-color'); |
- notificationElement.firstElementChild.textContent = text; |
+ notificationElement.firstElementChild.appendChild(parseHtmlSubset(text)); |
arv (Not doing code reviews)
2010/11/24 00:02:43
I would prefer if the parsing could be done outsid
Miranda Callahan
2010/11/24 00:39:41
Done.
|
+ |
actionLink.textContent = actionText; |
actionLink.onclick = doAction; |
@@ -859,6 +864,15 @@ |
notification.classList.add('first-run'); |
} |
+function showPromoNotification() { |
+ showNotification(localStrings.getString('serverpromo'), |
+ localStrings.getString('closefirstrunnotification'), |
+ function () { chrome.send('closePromo'); }, |
+ 60000); |
+ var notificationElement = $('notification'); |
+ notification.classList.add('promo'); |
+} |
+ |
$('main').addEventListener('click', function(e) { |
var p = e.target; |
while (p && p.tagName != 'H2') { |
@@ -1190,6 +1204,8 @@ |
// Only show the first run notification if first run. |
if (firstRun) { |
showFirstRunNotification(); |
+ } else if (localStrings.getString('serverpromo')) { |
+ showPromoNotification(); |
} |
} |