OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/notifications/message_center_stats_collector.h" | 5 #include "chrome/browser/notifications/message_center_stats_collector.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 actions_[type] = true; | 33 actions_[type] = true; |
34 } | 34 } |
35 | 35 |
36 void MessageCenterStatsCollector::NotificationStats::RecordAggregateStats() { | 36 void MessageCenterStatsCollector::NotificationStats::RecordAggregateStats() { |
37 DCHECK(!id_.empty()); | 37 DCHECK(!id_.empty()); |
38 | 38 |
39 for (size_t i = 0; i < NOTIFICATION_ACTION_COUNT; i++) { | 39 for (size_t i = 0; i < NOTIFICATION_ACTION_COUNT; i++) { |
40 if (!actions_[i]) | 40 if (!actions_[i]) |
41 continue; | 41 continue; |
42 UMA_HISTOGRAM_ENUMERATION("Notifications.PerNotificationActions", | 42 UMA_HISTOGRAM_ENUMERATION("Notifications.PerNotificationActions", |
43 i, | 43 static_cast<NotificationActionType>(i), |
44 NOTIFICATION_ACTION_COUNT); | 44 NOTIFICATION_ACTION_COUNT); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 MessageCenterStatsCollector::MessageCenterStatsCollector( | 48 MessageCenterStatsCollector::MessageCenterStatsCollector( |
49 message_center::MessageCenter* message_center) | 49 message_center::MessageCenter* message_center) |
50 : message_center_(message_center) { | 50 : message_center_(message_center) { |
51 message_center_->AddObserver(this); | 51 message_center_->AddObserver(this); |
52 } | 52 } |
53 | 53 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 void MessageCenterStatsCollector::OnQuietModeChanged(bool in_quiet_mode) { | 142 void MessageCenterStatsCollector::OnQuietModeChanged(bool in_quiet_mode) { |
143 if (in_quiet_mode) { | 143 if (in_quiet_mode) { |
144 base::RecordAction(base::UserMetricsAction("Notifications.Mute")); | 144 base::RecordAction(base::UserMetricsAction("Notifications.Mute")); |
145 } else { | 145 } else { |
146 base::RecordAction(base::UserMetricsAction("Notifications.Unmute")); | 146 base::RecordAction(base::UserMetricsAction("Notifications.Unmute")); |
147 } | 147 } |
148 } | 148 } |
OLD | NEW |