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