Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4014)

Unified Diff: chrome/browser/resources/ntp4/new_tab.js

Issue 11230014: Use UMA_HISTOGRAM_ENUMERATION instead of UMA_HISTOGRAM_BOOLEAN (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: set PROMO_VIEWED to 0 Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/new_tab_page_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/new_tab.js
===================================================================
--- chrome/browser/resources/ntp4/new_tab.js (revision 162974)
+++ chrome/browser/resources/ntp4/new_tab.js (working copy)
@@ -227,7 +227,7 @@
'selected');
if (loadTimeData.valueExists('notificationPromoText')) {
- var promo = loadTimeData.getString('notificationPromoText');
+ var promoText = loadTimeData.getString('notificationPromoText');
var tags = ['IMG'];
var attrs = {
src: function(node, value) {
@@ -235,7 +235,16 @@
/^data\:image\/(?:png|gif|jpe?g)/.test(value);
},
};
- showNotification(parseHtmlSubset(promo, tags, attrs), [], function() {
+
+ var promo = parseHtmlSubset(promoText, tags, attrs);
+ var promoLink = promo.querySelector('a');
+ if (promoLink) {
+ promoLink.addEventListener('click', function(e) {
+ chrome.send('notificationPromoLinkClicked');
+ });
+ }
+
+ showNotification(promo, [], function() {
chrome.send('notificationPromoClosed');
}, 60000);
chrome.send('notificationPromoViewed');
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/new_tab_page_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698