summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 23:43:30 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 23:43:30 +0000
commit6749c68237fcc188dac3520527d5d5210f6147fc (patch)
treed97e0a9d38d68a969bbfe45a55d7b56c8745737b /chrome/browser/resources
parent7f856bee73ffdccdbbbbbab4cb79185290d38359 (diff)
downloadchromium_src-6749c68237fcc188dac3520527d5d5210f6147fc.zip
chromium_src-6749c68237fcc188dac3520527d5d5210f6147fc.tar.gz
chromium_src-6749c68237fcc188dac3520527d5d5210f6147fc.tar.bz2
Add more UMA collection to the New Tab Page
BUG=1450986 Review URL: http://codereview.chromium.org/8686 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/new_tab.html17
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/browser/resources/new_tab.html b/chrome/browser/resources/new_tab.html
index 1372ba5..356976b 100644
--- a/chrome/browser/resources/new_tab.html
+++ b/chrome/browser/resources/new_tab.html
@@ -393,7 +393,7 @@ function DOM(elem, attrs) {
/* Return the DOM element for a "most visited" entry.
|page| should be an object with "title" and "url" fields. */
-function makeMostVisitedDOM(page) {
+function makeMostVisitedDOM(page, number) {
/* The HTML we want looks like this:
<a class="most-visited-item" href="URL" title="gmail.com">
<div class="thumbnail-title" style="background-image:url(faviconurl);">gmail.com</div>
@@ -402,7 +402,11 @@ function makeMostVisitedDOM(page) {
*/
var root;
if (page.url) {
- root = DOM('a', {href:page.url, title:page.title});
+ root = DOM('a', {href:page.url,
+ title:page.title});
+ root.addEventListener("mousedown", function(event) {
+ chrome.send("metrics", ["NTP_MostVisited" + number])
+ }, false);
} else {
// Something went wrong; don't make it clickable.
root = DOM('span');
@@ -457,7 +461,7 @@ function renderMostVisitedPages(pages) {
rows[rowNum] = DOM('tr', {});
}
- var dom = makeMostVisitedDOM(page);
+ var dom = makeMostVisitedDOM(page, i);
var cell = DOM('td');
cell.appendChild(dom);
@@ -543,7 +547,12 @@ function renderRecentlyBookmarked(entries) {
if (entries.length > 0) {
section.style.display = 'block';
for (var i = 0, entry = entries[0]; entry = entries[i]; ++i) {
- var link = DOM('a', {href: entry.url, className:'recent-bookmark', title:entry.title});
+ var link = DOM('a', {href: entry.url,
+ className:'recent-bookmark',
+ title:entry.title});
+ link.addEventListener("mousedown", function(event) {
+ chrome.send("metrics", ["NTP_Bookmark" + i])
+ }, false);
link.style.backgroundImage =
'url("chrome-resource://favicon/' + entry.url + '")';
link.appendChild(document.createTextNode(entry.title));