OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/notifications/sync_notifier/synced_notification_stats.h " | |
6 | |
7 #include <string> | |
8 | |
9 #include "base/metrics/histogram.h" | |
10 #include "content/public/browser/user_metrics.h" | |
11 | |
12 namespace notifier { | |
13 | |
14 SyncedNotificationStats::SyncedNotificationStats() {} | |
15 | |
16 SyncedNotificationStats::SyncedNotificationStats( | |
17 const std::string& id) : id_(id) { | |
18 for (size_t i = 0; i < SYNCED_NOTIFICATION_ACTION_COUNT; i++) { | |
Alexei Svitkine (slow)
2013/10/11 14:50:12
Nit: ++i and remove {}'s
Pete Williamson
2013/10/14 03:46:07
Done.
| |
19 actions_[i] = false; | |
20 } | |
21 } | |
22 | |
23 SyncedNotificationStats::~SyncedNotificationStats() {} | |
24 | |
25 void SyncedNotificationStats::CollectAction( | |
26 SyncedNotificationActionType type) { | |
27 DCHECK(!id_.empty()); | |
28 | |
29 UMA_HISTOGRAM_ENUMERATION("Notifications.Actions", | |
30 type, | |
31 SYNCED_NOTIFICATION_ACTION_COUNT); | |
32 actions_[type] = true; | |
33 } | |
34 | |
35 void SyncedNotificationStats::RecordAggregateStats() { | |
36 DCHECK(!id_.empty()); | |
37 | |
38 for (size_t i = 0; i < SYNCED_NOTIFICATION_ACTION_COUNT; i++) { | |
39 if (!actions_[i]) | |
40 continue; | |
41 UMA_HISTOGRAM_ENUMERATION("Notifications.PerNotificationActions", | |
42 i, | |
43 SYNCED_NOTIFICATION_ACTION_COUNT); | |
Alexei Svitkine (slow)
2013/10/11 14:50:12
This looks strange to me. I'm not familiar with th
Pete Williamson
2013/10/14 03:46:07
I was hoping to ask you if I needed it or not. I
Alexei Svitkine (slow)
2013/10/15 17:12:03
The other stuff should work on its own. Unless you
Pete Williamson
2013/10/16 02:24:21
OK, after a closer reading of the code, the PerNot
| |
44 } | |
45 } | |
46 | |
47 } // namespace notifier | |
OLD | NEW |