Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_STATS_H_ | |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_STATS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 | |
| 12 namespace notifier { | |
| 13 | |
| 14 enum SyncedNotificationActionType { | |
| 15 SYNCED_NOTIFICATION_ACTION_UNKNOWN, | |
| 16 SYNCED_NOTIFICATION_ACTION_CLICK, | |
| 17 SYNCED_NOTIFICATION_ACTION_BUTTON_CLICK, | |
| 18 SYNCED_NOTIFICATION_ACTION_CLOSE_BY_USER, | |
| 19 SYNCED_NOTIFICATION_ACTION_CLOSE_BY_SYSTEM, | |
| 20 SYNCED_NOTIFICATION_ACTION_TOAST_TIMEOUT, | |
| 21 // NOTE: Add new action types only immediately above this line. Also, | |
| 22 // make sure the enum list in tools/histogram/histograms.xml is | |
| 23 // updated with any change in here. | |
| 24 SYNCED_NOTIFICATION_ACTION_COUNT | |
| 25 }; | |
| 26 | |
| 27 // Represents the aggregate stats for each notification. | |
| 28 class SyncedNotificationStats { | |
| 29 public: | |
| 30 // Default constructor for map. | |
| 31 SyncedNotificationStats(); | |
| 32 | |
| 33 explicit SyncedNotificationStats(const std::string& id); | |
| 34 virtual ~SyncedNotificationStats(); | |
| 35 | |
| 36 // Called when we get an action from the message center. | |
| 37 void CollectAction(SyncedNotificationActionType type); | |
| 38 | |
| 39 // Sends aggregate data to UMA. | |
| 40 void RecordAggregateStats(); | |
| 41 | |
| 42 private: | |
| 43 std::string id_; | |
| 44 bool actions_[SYNCED_NOTIFICATION_ACTION_COUNT]; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(SyncedNotificationStats); | |
| 47 }; | |
| 48 | |
| 49 | |
|
Alexei Svitkine (slow)
2013/10/11 14:50:12
Nit: Remove extra blank line.
Pete Williamson
2013/10/14 03:46:07
Done.
| |
| 50 } // namespace notifier | |
| 51 | |
| 52 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_STATS_ H_ | |
| OLD | NEW |