| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 const std::string& notification_id, | 102 const std::string& notification_id, |
| 103 int button_index) { | 103 int button_index) { |
| 104 StatsCollection::iterator iter = stats_.find(notification_id); | 104 StatsCollection::iterator iter = stats_.find(notification_id); |
| 105 if (iter == stats_.end()) | 105 if (iter == stats_.end()) |
| 106 return; | 106 return; |
| 107 NotificationStats& notification_stat = iter->second; | 107 NotificationStats& notification_stat = iter->second; |
| 108 | 108 |
| 109 notification_stat.CollectAction(NOTIFICATION_ACTION_BUTTON_CLICK); | 109 notification_stat.CollectAction(NOTIFICATION_ACTION_BUTTON_CLICK); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void MessageCenterStatsCollector::OnNotificationSettingsClicked() { | 112 void MessageCenterStatsCollector::OnNotificationSettingsClicked(bool handled) { |
| 113 content::RecordAction( | 113 content::RecordAction( |
| 114 base::UserMetricsAction("Notifications.ShowSiteSettings")); | 114 base::UserMetricsAction("Notifications.ShowSiteSettings")); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void MessageCenterStatsCollector::OnNotificationDisplayed( | 117 void MessageCenterStatsCollector::OnNotificationDisplayed( |
| 118 const std::string& notification_id, | 118 const std::string& notification_id, |
| 119 const message_center::DisplaySource source) { | 119 const message_center::DisplaySource source) { |
| 120 StatsCollection::iterator iter = stats_.find(notification_id); | 120 StatsCollection::iterator iter = stats_.find(notification_id); |
| 121 if (iter == stats_.end()) | 121 if (iter == stats_.end()) |
| 122 return; | 122 return; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 143 | 143 |
| 144 void MessageCenterStatsCollector::OnQuietModeChanged(bool in_quiet_mode) { | 144 void MessageCenterStatsCollector::OnQuietModeChanged(bool in_quiet_mode) { |
| 145 if (in_quiet_mode) { | 145 if (in_quiet_mode) { |
| 146 content::RecordAction( | 146 content::RecordAction( |
| 147 base::UserMetricsAction("Notifications.Mute")); | 147 base::UserMetricsAction("Notifications.Mute")); |
| 148 } else { | 148 } else { |
| 149 content::RecordAction( | 149 content::RecordAction( |
| 150 base::UserMetricsAction("Notifications.Unmute")); | 150 base::UserMetricsAction("Notifications.Unmute")); |
| 151 } | 151 } |
| 152 } | 152 } |
| OLD | NEW |