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

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

Issue 8052028: NTP: Clean up of MetricsHandler class and namespacing chrome.send messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebasing changes Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ntp4/logging.js ('k') | chrome/browser/ui/webui/ntp/metrics_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 e.preventDefault(); 134 e.preventDefault();
135 } else { 135 } else {
136 // Records an app launch from the most visited page (Chrome will decide 136 // Records an app launch from the most visited page (Chrome will decide
137 // whether the url is an app). TODO(estade): this only works for clicks; 137 // whether the url is an app). TODO(estade): this only works for clicks;
138 // other actions like "open in new tab" from the context menu won't be 138 // other actions like "open in new tab" from the context menu won't be
139 // recorded. Can this be fixed? 139 // recorded. Can this be fixed?
140 chrome.send('recordAppLaunchByURL', 140 chrome.send('recordAppLaunchByURL',
141 [encodeURIComponent(this.href), 141 [encodeURIComponent(this.href),
142 ntp4.APP_LAUNCH.NTP_MOST_VISITED]); 142 ntp4.APP_LAUNCH.NTP_MOST_VISITED]);
143 // Records the index of this tile. 143 // Records the index of this tile.
144 chrome.send('recordInHistogram', ['NTP_MostVisited', this.index, 8]); 144 chrome.send('metricsHandler:recordInHistogram',
145 ['NTP_MostVisited', this.index, 8]);
145 } 146 }
146 }, 147 },
147 148
148 /** 149 /**
149 * Allow blacklisting most visited site using the keyboard. 150 * Allow blacklisting most visited site using the keyboard.
150 */ 151 */
151 handleKeyDown_: function(e) { 152 handleKeyDown_: function(e) {
152 if (!cr.isMac && e.keyCode == 46 || // Del 153 if (!cr.isMac && e.keyCode == 46 || // Del
153 cr.isMac && e.metaKey && e.keyCode == 8) { // Cmd + Backspace 154 cr.isMac && e.metaKey && e.keyCode == 8) { // Cmd + Backspace
154 this.blacklist_(); 155 this.blacklist_();
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 418 }
418 419
419 return oldData; 420 return oldData;
420 }; 421 };
421 422
422 return { 423 return {
423 MostVisitedPage: MostVisitedPage, 424 MostVisitedPage: MostVisitedPage,
424 refreshData: refreshData, 425 refreshData: refreshData,
425 }; 426 };
426 }); 427 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/logging.js ('k') | chrome/browser/ui/webui/ntp/metrics_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698