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 const NotificationList::Notifications& GetNotifications() OVERRIDE; | 29 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; |
28 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; | 30 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; |
29 virtual void AddNotification( | 31 virtual void AddNotification(NotificationType type, |
30 NotificationType type, | 32 const std::string& id, |
31 const std::string& id, | 33 const string16& title, |
32 const string16& title, | 34 const string16& message, |
33 const string16& message, | 35 const string16& display_source, |
34 const string16& display_source, | 36 const std::string& extension_id, |
35 const std::string& extension_id, | 37 const base::DictionaryValue* optional_fields, |
36 const base::DictionaryValue* optional_fields) OVERRIDE; | 38 NotificationDelegate* delegate) OVERRIDE; |
37 virtual void UpdateNotification( | 39 virtual void UpdateNotification(const std::string& old_id, |
38 const std::string& old_id, | 40 const std::string& new_id, |
39 const std::string& new_id, | 41 const string16& title, |
40 const string16& title, | 42 const string16& message, |
41 const string16& message, | 43 const base::DictionaryValue* optional_fields) |
42 const base::DictionaryValue* optional_fields) OVERRIDE; | 44 OVERRIDE; |
43 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; | 45 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; |
44 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; | 46 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; |
45 virtual void SetNotificationIcon(const std::string& notification_id, | 47 virtual void SetNotificationIcon(const std::string& notification_id, |
46 const gfx::Image& image) OVERRIDE; | 48 const gfx::Image& image) OVERRIDE; |
47 | 49 |
48 virtual void SetNotificationImage(const std::string& notification_id, | 50 virtual void SetNotificationImage(const std::string& notification_id, |
49 const gfx::Image& image) OVERRIDE; | 51 const gfx::Image& image) OVERRIDE; |
50 | 52 |
51 virtual void SetNotificationButtonIcon(const std::string& notification_id, | 53 virtual void SetNotificationButtonIcon(const std::string& notification_id, |
52 int button_index, | 54 int button_index, |
(...skipping 16 matching lines...) Expand all Loading... |
69 | 71 |
70 private: | 72 private: |
71 const NotificationList::Notifications empty_notifications_; | 73 const NotificationList::Notifications empty_notifications_; |
72 | 74 |
73 DISALLOW_COPY_AND_ASSIGN(FakeMessageCenter); | 75 DISALLOW_COPY_AND_ASSIGN(FakeMessageCenter); |
74 }; | 76 }; |
75 | 77 |
76 } // namespace message_center | 78 } // namespace message_center |
77 | 79 |
78 #endif // UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ | 80 #endif // UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_ |
OLD | NEW |