OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ | 5 #ifndef UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ |
6 #define UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ | 6 #define UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ |
7 | 7 |
8 #include "ui/message_center/message_center.h" | 8 #include "ui/message_center/message_center.h" |
| 9 #include "ui/message_center/message_center_types.h" |
9 | 10 |
10 namespace message_center { | 11 namespace message_center { |
11 | 12 |
12 class NotificationDelegate; | 13 class NotificationDelegate; |
13 | 14 |
14 // MessageCenter implementation of doing nothing. Useful for tests. | 15 // MessageCenter implementation of doing nothing. Useful for tests. |
15 class FakeMessageCenter : public MessageCenter { | 16 class FakeMessageCenter : public MessageCenter { |
16 public: | 17 public: |
17 FakeMessageCenter(); | 18 FakeMessageCenter(); |
18 virtual ~FakeMessageCenter(); | 19 virtual ~FakeMessageCenter(); |
19 | 20 |
20 // Overridden from FakeMessageCenter. | 21 // Overridden from FakeMessageCenter. |
21 virtual void SetDelegate(Delegate* delegate) OVERRIDE; | |
22 virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE; | 22 virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE; |
23 virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE; | 23 virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE; |
24 virtual size_t NotificationCount() const OVERRIDE; | 24 virtual size_t NotificationCount() const OVERRIDE; |
25 virtual size_t UnreadNotificationCount() const OVERRIDE; | 25 virtual size_t UnreadNotificationCount() const OVERRIDE; |
26 virtual bool HasPopupNotifications() const OVERRIDE; | 26 virtual bool HasPopupNotifications() const OVERRIDE; |
27 virtual bool HasNotification(const std::string& id) OVERRIDE; | 27 virtual bool HasNotification(const std::string& id) OVERRIDE; |
28 virtual bool IsQuietMode() const OVERRIDE; | 28 virtual bool IsQuietMode() const OVERRIDE; |
29 virtual bool HasClickedListener(const std::string& id) OVERRIDE; | 29 virtual bool HasClickedListener(const std::string& id) OVERRIDE; |
30 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; | 30 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; |
31 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; | 31 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; |
32 virtual void AddNotification(scoped_ptr<Notification> notification) OVERRIDE; | 32 virtual void AddNotification(scoped_ptr<Notification> notification) OVERRIDE; |
33 virtual void UpdateNotification(const std::string& old_id, | 33 virtual void UpdateNotification(const std::string& old_id, |
34 scoped_ptr<Notification> new_notification) | 34 scoped_ptr<Notification> new_notification) |
35 OVERRIDE; | 35 OVERRIDE; |
36 | 36 |
37 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; | 37 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; |
38 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; | 38 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; |
39 virtual void SetNotificationIcon(const std::string& notification_id, | 39 virtual void SetNotificationIcon(const std::string& notification_id, |
40 const gfx::Image& image) OVERRIDE; | 40 const gfx::Image& image) OVERRIDE; |
41 | 41 |
42 virtual void SetNotificationImage(const std::string& notification_id, | 42 virtual void SetNotificationImage(const std::string& notification_id, |
43 const gfx::Image& image) OVERRIDE; | 43 const gfx::Image& image) OVERRIDE; |
44 | 44 |
45 virtual void SetNotificationButtonIcon(const std::string& notification_id, | 45 virtual void SetNotificationButtonIcon(const std::string& notification_id, |
46 int button_index, | 46 int button_index, |
47 const gfx::Image& image) OVERRIDE; | 47 const gfx::Image& image) OVERRIDE; |
48 virtual void DisableNotificationsByNotifier( | 48 virtual void DisableNotificationsByNotifier( |
49 const NotifierId& notifier_id) OVERRIDE; | 49 const NotifierId& notifier_id) OVERRIDE; |
50 virtual void ShowNotificationSettings(const std::string& id) OVERRIDE; | |
51 virtual void ExpandNotification(const std::string& id) OVERRIDE; | 50 virtual void ExpandNotification(const std::string& id) OVERRIDE; |
52 virtual void ClickOnNotification(const std::string& id) OVERRIDE; | 51 virtual void ClickOnNotification(const std::string& id) OVERRIDE; |
53 virtual void ClickOnNotificationButton(const std::string& id, | 52 virtual void ClickOnNotificationButton(const std::string& id, |
54 int button_index) OVERRIDE; | 53 int button_index) OVERRIDE; |
55 virtual void MarkSinglePopupAsShown(const std::string& id, | 54 virtual void MarkSinglePopupAsShown(const std::string& id, |
56 bool mark_notification_as_read) OVERRIDE; | 55 bool mark_notification_as_read) OVERRIDE; |
57 virtual void DisplayedNotification(const std::string& id) OVERRIDE; | 56 virtual void DisplayedNotification(const std::string& id) OVERRIDE; |
58 virtual void SetNotifierSettingsProvider( | 57 virtual void SetNotifierSettingsProvider( |
59 NotifierSettingsProvider* provider) OVERRIDE; | 58 NotifierSettingsProvider* provider) OVERRIDE; |
60 virtual NotifierSettingsProvider* GetNotifierSettingsProvider() OVERRIDE; | 59 virtual NotifierSettingsProvider* GetNotifierSettingsProvider() OVERRIDE; |
61 virtual void SetQuietMode(bool in_quiet_mode) OVERRIDE; | 60 virtual void SetQuietMode(bool in_quiet_mode) OVERRIDE; |
62 virtual void EnterQuietModeWithExpire( | 61 virtual void EnterQuietModeWithExpire( |
63 const base::TimeDelta& expires_in) OVERRIDE; | 62 const base::TimeDelta& expires_in) OVERRIDE; |
64 virtual void SetMessageCenterVisible(bool visible) OVERRIDE; | 63 virtual void SetVisibility(Visibility visible) OVERRIDE; |
65 virtual bool IsMessageCenterVisible() OVERRIDE; | 64 virtual bool IsMessageCenterVisible() OVERRIDE; |
66 virtual void RestartPopupTimers() OVERRIDE; | 65 virtual void RestartPopupTimers() OVERRIDE; |
67 virtual void PausePopupTimers() OVERRIDE; | 66 virtual void PausePopupTimers() OVERRIDE; |
68 | 67 |
69 protected: | 68 protected: |
70 virtual void DisableTimersForTest() OVERRIDE; | 69 virtual void DisableTimersForTest() OVERRIDE; |
71 | 70 |
72 private: | 71 private: |
73 const NotificationList::Notifications empty_notifications_; | 72 const NotificationList::Notifications empty_notifications_; |
74 | 73 |
75 DISALLOW_COPY_AND_ASSIGN(FakeMessageCenter); | 74 DISALLOW_COPY_AND_ASSIGN(FakeMessageCenter); |
76 }; | 75 }; |
77 | 76 |
78 } // namespace message_center | 77 } // namespace message_center |
79 | 78 |
80 #endif // UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ | 79 #endif // UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ |
OLD | NEW |