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

Unified Diff: chrome/browser/resources/google_now/background.js

Issue 15306005: Adding location events to the histogram (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rgustafson's notes Created 7 years, 7 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/google_now/background.js
diff --git a/chrome/browser/resources/google_now/background.js b/chrome/browser/resources/google_now/background.js
index 0fdbd6724c10e7292d530e9fbf3dc12adacdf8ec..cd7b5a96a1da87e9f2aefef19e9ed6e36f30f55c 100644
--- a/chrome/browser/resources/google_now/background.js
+++ b/chrome/browser/resources/google_now/background.js
@@ -141,7 +141,9 @@ var DiagnosticEvent = {
CARDS_PARSE_SUCCESS: 2,
DISMISS_REQUEST_TOTAL: 3,
DISMISS_REQUEST_SUCCESS: 4,
- EVENTS_TOTAL: 5 // EVENTS_TOTAL is not an event; all new events need to be
+ LOCATION_REQUEST: 5,
+ LOCATION_UPDATE: 6,
+ EVENTS_TOTAL: 7 // EVENTS_TOTAL is not an event; all new events need to be
// added before it.
};
@@ -363,6 +365,7 @@ function requestNotificationCards(position, callback) {
*/
function requestLocation() {
console.log('requestLocation');
+ recordEvent(DiagnosticEvent.LOCATION_REQUEST);
// TODO(vadimt): Figure out location request options.
chrome.location.watchLocation(LOCATION_WATCH_NAME, {});
}
@@ -603,4 +606,7 @@ chrome.notifications.onButtonClicked.addListener(
chrome.notifications.onClosed.addListener(onNotificationClosed);
-chrome.location.onLocationUpdate.addListener(updateNotificationsCards);
+chrome.location.onLocationUpdate.addListener(function(position) {
+ recordEvent(DiagnosticEvent.LOCATION_UPDATE);
+ updateNotificationsCards(position);
+});
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698