Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: chrome/browser/notifications/message_center_notification_manager.h

Issue 23636010: Notifications: Add cross-platform UMA: ShowMessageCenter, ShowSettings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove spurious test code. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 class MessageCenterSettingsController; 25 class MessageCenterSettingsController;
26 class Notification; 26 class Notification;
27 class PrefService; 27 class PrefService;
28 class Profile; 28 class Profile;
29 29
30 // This class extends NotificationUIManagerImpl and delegates actual display 30 // This class extends NotificationUIManagerImpl and delegates actual display
31 // of notifications to MessageCenter, doing necessary conversions. 31 // of notifications to MessageCenter, doing necessary conversions.
32 class MessageCenterNotificationManager 32 class MessageCenterNotificationManager
33 : public NotificationUIManagerImpl, 33 : public NotificationUIManagerImpl,
34 public message_center::MessageCenter::Delegate,
35 public message_center::MessageCenterObserver { 34 public message_center::MessageCenterObserver {
36 public: 35 public:
37 MessageCenterNotificationManager( 36 MessageCenterNotificationManager(
38 message_center::MessageCenter* message_center, 37 message_center::MessageCenter* message_center,
39 PrefService* local_state, 38 PrefService* local_state,
40 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider); 39 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider);
41 virtual ~MessageCenterNotificationManager(); 40 virtual ~MessageCenterNotificationManager();
42 41
43 // NotificationUIManager 42 // NotificationUIManager
44 virtual const Notification* FindById( 43 virtual const Notification* FindById(
45 const std::string& notification_id) const OVERRIDE; 44 const std::string& notification_id) const OVERRIDE;
46 virtual bool CancelById(const std::string& notification_id) OVERRIDE; 45 virtual bool CancelById(const std::string& notification_id) OVERRIDE;
47 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( 46 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
48 Profile* profile, 47 Profile* profile,
49 const GURL& source) OVERRIDE; 48 const GURL& source) OVERRIDE;
50 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE; 49 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE;
51 virtual bool CancelAllByProfile(Profile* profile) OVERRIDE; 50 virtual bool CancelAllByProfile(Profile* profile) OVERRIDE;
52 virtual void CancelAll() OVERRIDE; 51 virtual void CancelAll() OVERRIDE;
53 52
54 // NotificationUIManagerImpl 53 // NotificationUIManagerImpl
55 virtual bool ShowNotification(const Notification& notification, 54 virtual bool ShowNotification(const Notification& notification,
56 Profile* profile) OVERRIDE; 55 Profile* profile) OVERRIDE;
57 virtual bool UpdateNotification(const Notification& notification, 56 virtual bool UpdateNotification(const Notification& notification,
58 Profile* profile) OVERRIDE; 57 Profile* profile) OVERRIDE;
59 58
60 // MessageCenter::Delegate
61 virtual void ShowSettings(const std::string& notification_id) OVERRIDE;
62
63 // MessageCenterObserver 59 // MessageCenterObserver
64 virtual void OnNotificationRemoved(const std::string& notification_id, 60 virtual void OnNotificationRemoved(const std::string& notification_id,
65 bool by_user) OVERRIDE; 61 bool by_user) OVERRIDE;
66 virtual void OnNotificationCenterClosed() OVERRIDE; 62 virtual void OnCenterVisibilityChanged(message_center::Visibility) OVERRIDE;
67 virtual void OnNotificationUpdated(const std::string& notification_id) 63 virtual void OnNotificationUpdated(const std::string& notification_id)
68 OVERRIDE; 64 OVERRIDE;
69 65
70 #if defined(OS_WIN) 66 #if defined(OS_WIN)
71 // Called when the pref changes for the first run balloon. The first run 67 // Called when the pref changes for the first run balloon. The first run
72 // balloon is only displayed on Windows, since the visibility of the tray 68 // balloon is only displayed on Windows, since the visibility of the tray
73 // icon is limited. 69 // icon is limited.
74 void DisplayFirstRunBalloon(); 70 void DisplayFirstRunBalloon();
75 71
76 void SetFirstRunTimeoutForTest(base::TimeDelta timeout); 72 void SetFirstRunTimeoutForTest(base::TimeDelta timeout);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 215
220 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider_; 216 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider_;
221 217
222 // Registrar for the other kind of notifications (event signaling). 218 // Registrar for the other kind of notifications (event signaling).
223 content::NotificationRegistrar registrar_; 219 content::NotificationRegistrar registrar_;
224 220
225 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); 221 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager);
226 }; 222 };
227 223
228 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ 224 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698