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