OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * @fileoverview The event page for Google Now for Chrome implementation. | 8 * @fileoverview The event page for Google Now for Chrome implementation. |
9 * The Google Now event page gets Google Now cards from the server and shows | 9 * The Google Now event page gets Google Now cards from the server and shows |
10 * them as Chrome notifications. | 10 * them as Chrome notifications. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // added before it. | 270 // added before it. |
271 }; | 271 }; |
272 | 272 |
273 /** | 273 /** |
274 * Records a Google Now Event. | 274 * Records a Google Now Event. |
275 * @param {GoogleNowEvent} event Event identifier. | 275 * @param {GoogleNowEvent} event Event identifier. |
276 */ | 276 */ |
277 function recordEvent(event) { | 277 function recordEvent(event) { |
278 var metricDescription = { | 278 var metricDescription = { |
279 metricName: 'GoogleNow.Event', | 279 metricName: 'GoogleNow.Event', |
280 type: 'histogram-linear', | 280 type: chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR, |
281 min: 1, | 281 min: 1, |
282 max: GoogleNowEvent.EVENTS_TOTAL, | 282 max: GoogleNowEvent.EVENTS_TOTAL, |
283 buckets: GoogleNowEvent.EVENTS_TOTAL + 1 | 283 buckets: GoogleNowEvent.EVENTS_TOTAL + 1 |
284 }; | 284 }; |
285 | 285 |
286 chrome.metricsPrivate.recordValue(metricDescription, event); | 286 chrome.metricsPrivate.recordValue(metricDescription, event); |
287 } | 287 } |
288 | 288 |
289 /** | 289 /** |
290 * Records a notification clicked event. | 290 * Records a notification clicked event. |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 lastPollNowPayloads: items.lastPollNowPayloads, | 1495 lastPollNowPayloads: items.lastPollNowPayloads, |
1496 notificationGroups: items.notificationGroups | 1496 notificationGroups: items.notificationGroups |
1497 }); | 1497 }); |
1498 | 1498 |
1499 pollOptedInWithRecheck(); | 1499 pollOptedInWithRecheck(); |
1500 } | 1500 } |
1501 }); | 1501 }); |
1502 }); | 1502 }); |
1503 } | 1503 } |
1504 }); | 1504 }); |
OLD | NEW |