OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_GOOGLE_NOW_NOTIFICATION_STATS_COLLECTOR_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_GOOGLE_NOW_NOTIFICATION_STATS_COLLECTOR_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "ui/message_center/message_center.h" |
| 11 #include "ui/message_center/message_center_observer.h" |
| 12 #include "ui/message_center/message_center_types.h" |
| 13 |
| 14 // The Google Now Notification Stats Collector listens for message center |
| 15 // events and records stats about Google Now specific notifications. |
| 16 class GoogleNowNotificationStatsCollector |
| 17 : public message_center::MessageCenterObserver { |
| 18 public: |
| 19 explicit GoogleNowNotificationStatsCollector( |
| 20 message_center::MessageCenter* message_center); |
| 21 virtual ~GoogleNowNotificationStatsCollector(); |
| 22 |
| 23 private: |
| 24 // MessageCenterObserver |
| 25 virtual void OnNotificationPoppedUp( |
| 26 const std::string& notification_id) OVERRIDE; |
| 27 virtual void OnCenterVisibilityChanged( |
| 28 message_center::Visibility visibility) OVERRIDE; |
| 29 |
| 30 // Counts the number of Google Now Notifications in the message center. |
| 31 int CountVisibleGoogleNowNotifications(); |
| 32 |
| 33 // Returns true if the notification ID is for Google Now. |
| 34 bool IsNotificationIdForGoogleNow(const std::string& notification_id); |
| 35 |
| 36 // Weak, global. |
| 37 message_center::MessageCenter* message_center_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(GoogleNowNotificationStatsCollector); |
| 40 }; |
| 41 |
| 42 #endif // CHROME_BROWSER_NOTIFICATIONS_GOOGLE_NOW_NOTIFICATION_STATS_COLLECTOR_
H_ |
OLD | NEW |