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

Side by Side Diff: chrome/browser/resources/ntp4/most_visited_page.js

Issue 7550015: ntp4: record app launch source (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 cr.define('ntp4', function() { 5 cr.define('ntp4', function() {
6 'use strict'; 6 'use strict';
7 7
8 var TilePage = ntp4.TilePage; 8 var TilePage = ntp4.TilePage;
9 9
10 /** 10 /**
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 /** 112 /**
113 * Handles a click on the tile. 113 * Handles a click on the tile.
114 * @param {Event} e The click event. 114 * @param {Event} e The click event.
115 */ 115 */
116 handleClick_: function(e) { 116 handleClick_: function(e) {
117 if (e.target.classList.contains('close-button')) { 117 if (e.target.classList.contains('close-button')) {
118 this.blacklist_(); 118 this.blacklist_();
119 e.preventDefault(); 119 e.preventDefault();
120 } else { 120 } else {
121 // Records an app launch from the most visited page (Chrome will decide
122 // whether the url is an app).
123 // TODO(estade): don't convert to string.
124 chrome.send('recordAppLaunchByURL',
Rick Byers 2011/08/03 14:41:11 Is replacing the ping with a click handler really
Evan Stade 2011/08/03 22:11:22 I would have thought you were right, but ping does
Rick Byers 2011/08/04 00:32:21 That sucks - seems like a bug according to the spe
125 [this.href, String(ntp4.APP_LAUNCH.NTP_MOST_VISITED)]);
126 // Records the index of this tile.
121 chrome.send('recordInHistogram', ['NTP_MostVisited', this.index, 8]); 127 chrome.send('recordInHistogram', ['NTP_MostVisited', this.index, 8]);
122 } 128 }
123 }, 129 },
124 130
125 /** 131 /**
126 * Allow blacklisting most visited site using the keyboard. 132 * Allow blacklisting most visited site using the keyboard.
127 */ 133 */
128 handleKeyDown_: function(e) { 134 handleKeyDown_: function(e) {
129 if (!IS_MAC && e.keyCode == 46 || // Del 135 if (!IS_MAC && e.keyCode == 46 || // Del
130 IS_MAC && e.metaKey && e.keyCode == 8) { // Cmd + Backspace 136 IS_MAC && e.metaKey && e.keyCode == 8) { // Cmd + Backspace
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (tile) 369 if (tile)
364 tile.setStripeColor(color); 370 tile.setStripeColor(color);
365 }; 371 };
366 372
367 return { 373 return {
368 MostVisitedPage: MostVisitedPage, 374 MostVisitedPage: MostVisitedPage,
369 refreshData: refreshData, 375 refreshData: refreshData,
370 setFaviconDominantColor: setFaviconDominantColor, 376 setFaviconDominantColor: setFaviconDominantColor,
371 }; 377 };
372 }); 378 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698