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