| 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; |
| 13 |
| 12 // MessageCenter implementation of doing nothing. Useful for tests. | 14 // MessageCenter implementation of doing nothing. Useful for tests. |
| 13 class FakeMessageCenter : public MessageCenter { | 15 class FakeMessageCenter : public MessageCenter { |
| 14 public: | 16 public: |
| 15 FakeMessageCenter(); | 17 FakeMessageCenter(); |
| 16 virtual ~FakeMessageCenter(); | 18 virtual ~FakeMessageCenter(); |
| 17 | 19 |
| 18 // Overridden from FakeMessageCenter. | 20 // Overridden from FakeMessageCenter. |
| 19 virtual void SetDelegate(Delegate* delegate) OVERRIDE; | 21 virtual void SetDelegate(Delegate* delegate) OVERRIDE; |
| 20 virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE; | 22 virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE; |
| 21 virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE; | 23 virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE; |
| 22 virtual size_t NotificationCount() const OVERRIDE; | 24 virtual size_t NotificationCount() const OVERRIDE; |
| 23 virtual size_t UnreadNotificationCount() const OVERRIDE; | 25 virtual size_t UnreadNotificationCount() const OVERRIDE; |
| 24 virtual bool HasPopupNotifications() const OVERRIDE; | 26 virtual bool HasPopupNotifications() const OVERRIDE; |
| 25 virtual bool HasNotification(const std::string& id) OVERRIDE; | 27 virtual bool HasNotification(const std::string& id) OVERRIDE; |
| 26 virtual bool IsQuietMode() const OVERRIDE; | 28 virtual bool IsQuietMode() const OVERRIDE; |
| 27 virtual bool HasClickedListener(const std::string& id) OVERRIDE; | 29 virtual bool HasClickedListener(const std::string& id) OVERRIDE; |
| 28 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; | 30 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; |
| 29 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; | 31 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; |
| 30 virtual void AddNotification( | 32 virtual void AddNotification(NotificationType type, |
| 31 NotificationType type, | 33 const std::string& id, |
| 32 const std::string& id, | 34 const string16& title, |
| 33 const string16& title, | 35 const string16& message, |
| 34 const string16& message, | 36 const string16& display_source, |
| 35 const string16& display_source, | 37 const std::string& extension_id, |
| 36 const std::string& extension_id, | 38 const base::DictionaryValue* optional_fields, |
| 37 const base::DictionaryValue* optional_fields) OVERRIDE; | 39 NotificationDelegate* delegate) OVERRIDE; |
| 38 virtual void UpdateNotification( | 40 virtual void UpdateNotification(const std::string& old_id, |
| 39 const std::string& old_id, | 41 const std::string& new_id, |
| 40 const std::string& new_id, | 42 const string16& title, |
| 41 const string16& title, | 43 const string16& message, |
| 42 const string16& message, | 44 const base::DictionaryValue* optional_fields, |
| 43 const base::DictionaryValue* optional_fields) OVERRIDE; | 45 NotificationDelegate* delegate) OVERRIDE; |
| 44 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; | 46 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; |
| 45 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; | 47 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; |
| 46 virtual void SetNotificationIcon(const std::string& notification_id, | 48 virtual void SetNotificationIcon(const std::string& notification_id, |
| 47 const gfx::Image& image) OVERRIDE; | 49 const gfx::Image& image) OVERRIDE; |
| 48 | 50 |
| 49 virtual void SetNotificationImage(const std::string& notification_id, | 51 virtual void SetNotificationImage(const std::string& notification_id, |
| 50 const gfx::Image& image) OVERRIDE; | 52 const gfx::Image& image) OVERRIDE; |
| 51 | 53 |
| 52 virtual void SetNotificationButtonIcon(const std::string& notification_id, | 54 virtual void SetNotificationButtonIcon(const std::string& notification_id, |
| 53 int button_index, | 55 int button_index, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 70 | 72 |
| 71 private: | 73 private: |
| 72 const NotificationList::Notifications empty_notifications_; | 74 const NotificationList::Notifications empty_notifications_; |
| 73 | 75 |
| 74 DISALLOW_COPY_AND_ASSIGN(FakeMessageCenter); | 76 DISALLOW_COPY_AND_ASSIGN(FakeMessageCenter); |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace message_center | 79 } // namespace message_center |
| 78 | 80 |
| 79 #endif // UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ | 81 #endif // UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ |
| OLD | NEW |