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

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

Issue 9958116: Adds the NewTabPage.SuggestedSitesAction stat. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removed static variable that required an exit-time destructor. Created 8 years, 9 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/suggestions_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/suggestions_page.js
===================================================================
--- chrome/browser/resources/ntp4/suggestions_page.js (revision 130353)
+++ chrome/browser/resources/ntp4/suggestions_page.js (working copy)
@@ -134,6 +134,7 @@
// Records the index of this tile.
chrome.send('metricsHandler:recordInHistogram',
['NewTabPage.SuggestedSite', this.index, 8]);
+ chrome.send('suggestedSitesAction', [1]);
Evan Stade 2012/04/03 22:52:33 you need an enum, don't just toss magic values aro
macourteau 2012/04/04 19:41:09 Done.
}
},
@@ -286,6 +287,9 @@
this.classList.add('suggestions-page');
this.data_ = null;
this.suggestionsTiles_ = this.getElementsByClassName('suggestions real');
+
+ this.addEventListener('carddeselected', this.handleCardDeselected_);
+ this.addEventListener('cardselected', this.handleCardSelected_);
},
/**
@@ -314,6 +318,24 @@
},
/**
+ * Handles the 'card deselected' event (i.e. the user clicked to another
+ * pane).
+ * @param {Event} e The CardChanged event.
+ */
+ handleCardDeselected_: function(e) {
+ chrome.send('suggestedSitesAction', [2]);
+ },
+
+ /**
+ * Handles the 'card selected' event (i.e. the user clicked to select the
+ * Suggested pane).
+ * @param {Event} e The CardChanged event.
+ */
+ handleCardSelected_: function(e) {
+ chrome.send('suggestedSitesSelected');
+ },
+
+ /**
* Array of suggestions data objects.
* @type {Array}
*/
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/suggestions_page_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698