OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_MESSAGE_CENTER_IMPL_H_ | 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_IMPL_H_ |
6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_IMPL_H_ | 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ui/message_center/message_center.h" | 10 #include "ui/message_center/message_center.h" |
11 | 11 |
12 namespace message_center { | 12 namespace message_center { |
13 | 13 |
| 14 class NotificationDelegate; |
| 15 |
14 // The default implementation of MessageCenter. | 16 // The default implementation of MessageCenter. |
15 class MessageCenterImpl : public MessageCenter { | 17 class MessageCenterImpl : public MessageCenter { |
16 public: | 18 public: |
17 MessageCenterImpl(); | 19 MessageCenterImpl(); |
18 virtual ~MessageCenterImpl(); | 20 virtual ~MessageCenterImpl(); |
19 | 21 |
20 // MessageCenter overrides: | 22 // MessageCenter overrides: |
21 virtual void SetDelegate(Delegate* delegate) OVERRIDE; | 23 virtual void SetDelegate(Delegate* delegate) OVERRIDE; |
22 virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE; | 24 virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE; |
23 virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE; | 25 virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE; |
24 virtual void SetMessageCenterVisible(bool visible) OVERRIDE; | 26 virtual void SetMessageCenterVisible(bool visible) OVERRIDE; |
25 virtual size_t NotificationCount() const OVERRIDE; | 27 virtual size_t NotificationCount() const OVERRIDE; |
26 virtual size_t UnreadNotificationCount() const OVERRIDE; | 28 virtual size_t UnreadNotificationCount() const OVERRIDE; |
27 virtual bool HasPopupNotifications() const OVERRIDE; | 29 virtual bool HasPopupNotifications() const OVERRIDE; |
28 virtual bool HasNotification(const std::string& id) OVERRIDE; | 30 virtual bool HasNotification(const std::string& id) OVERRIDE; |
29 virtual bool IsQuietMode() const OVERRIDE; | 31 virtual bool IsQuietMode() const OVERRIDE; |
30 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; | 32 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; |
31 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; | 33 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; |
32 virtual void AddNotification( | 34 virtual void AddNotification(NotificationType type, |
33 NotificationType type, | 35 const std::string& id, |
34 const std::string& id, | 36 const string16& title, |
35 const string16& title, | 37 const string16& message, |
36 const string16& message, | 38 const string16& display_source, |
37 const string16& display_source, | 39 const std::string& extension_id, |
38 const std::string& extension_id, | 40 const base::DictionaryValue* optional_fields, |
39 const base::DictionaryValue* optional_fields) OVERRIDE; | 41 NotificationDelegate* delegate) OVERRIDE; |
40 virtual void UpdateNotification( | 42 virtual void UpdateNotification(const std::string& old_id, |
41 const std::string& old_id, | 43 const std::string& new_id, |
42 const std::string& new_id, | 44 const string16& title, |
43 const string16& title, | 45 const string16& message, |
44 const string16& message, | 46 const base::DictionaryValue* optional_fields) |
45 const base::DictionaryValue* optional_fields) OVERRIDE; | 47 OVERRIDE; |
46 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; | 48 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; |
47 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; | 49 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; |
48 virtual void SetNotificationIcon(const std::string& notification_id, | 50 virtual void SetNotificationIcon(const std::string& notification_id, |
49 const gfx::Image& image) OVERRIDE; | 51 const gfx::Image& image) OVERRIDE; |
50 virtual void SetNotificationImage(const std::string& notification_id, | 52 virtual void SetNotificationImage(const std::string& notification_id, |
51 const gfx::Image& image) OVERRIDE; | 53 const gfx::Image& image) OVERRIDE; |
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, |
54 const gfx::Image& image) OVERRIDE; | 56 const gfx::Image& image) OVERRIDE; |
55 virtual void DisableNotificationsByExtension(const std::string& id) OVERRIDE; | 57 virtual void DisableNotificationsByExtension(const std::string& id) OVERRIDE; |
(...skipping 15 matching lines...) Expand all Loading... |
71 scoped_ptr<NotificationList> notification_list_; | 73 scoped_ptr<NotificationList> notification_list_; |
72 ObserverList<MessageCenterObserver> observer_list_; | 74 ObserverList<MessageCenterObserver> observer_list_; |
73 Delegate* delegate_; | 75 Delegate* delegate_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(MessageCenterImpl); | 77 DISALLOW_COPY_AND_ASSIGN(MessageCenterImpl); |
76 }; | 78 }; |
77 | 79 |
78 } // namespace message_center | 80 } // namespace message_center |
79 | 81 |
80 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 82 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
OLD | NEW |