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

Side by Side Diff: chrome/browser/notifications/message_center_stats_collector.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/android_metrics_provider.cc ('k') | chrome/browser/policy/cloud/cloud_policy_invalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698