Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / notifications / google_now_notification_stats_collector.h
blob9ce460bb90568a77a14b8b52c724293e72829b13
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.
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_GOOGLE_NOW_NOTIFICATION_STATS_COLLECTOR_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_GOOGLE_NOW_NOTIFICATION_STATS_COLLECTOR_H_
8 #include <string>
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"
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 ~GoogleNowNotificationStatsCollector() override;
23 private:
24 // MessageCenterObserver
25 void OnNotificationDisplayed(
26 const std::string& notification_id,
27 const message_center::DisplaySource source) override;
28 void OnCenterVisibilityChanged(
29 message_center::Visibility visibility) override;
31 // Counts the number of Google Now Notifications in the message center.
32 int CountVisibleGoogleNowNotifications();
34 // Returns true if the ID of a visible notification is for Google Now.
35 bool IsVisibleNotificationIdForGoogleNow(const std::string& notification_id);
37 // Weak, global.
38 message_center::MessageCenter* message_center_;
40 DISALLOW_COPY_AND_ASSIGN(GoogleNowNotificationStatsCollector);
43 #endif // CHROME_BROWSER_NOTIFICATIONS_GOOGLE_NOW_NOTIFICATION_STATS_COLLECTOR_H_