| 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 bool HasClickedListener(const std::string& id) OVERRIDE; | 32 virtual bool HasClickedListener(const std::string& id) OVERRIDE; |
| 31 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; | 33 virtual const NotificationList::Notifications& GetNotifications() OVERRIDE; |
| 32 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; | 34 virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE; |
| 33 virtual void AddNotification( | 35 virtual void AddNotification(NotificationType type, |
| 34 NotificationType type, | 36 const std::string& id, |
| 35 const std::string& id, | 37 const string16& title, |
| 36 const string16& title, | 38 const string16& message, |
| 37 const string16& message, | 39 const string16& display_source, |
| 38 const string16& display_source, | 40 const std::string& extension_id, |
| 39 const std::string& extension_id, | 41 const base::DictionaryValue* optional_fields, |
| 40 const base::DictionaryValue* optional_fields) OVERRIDE; | 42 NotificationDelegate* delegate) OVERRIDE; |
| 41 virtual void UpdateNotification( | 43 virtual void UpdateNotification(const std::string& old_id, |
| 42 const std::string& old_id, | 44 const std::string& new_id, |
| 43 const std::string& new_id, | 45 const string16& title, |
| 44 const string16& title, | 46 const string16& message, |
| 45 const string16& message, | 47 const base::DictionaryValue* optional_fields, |
| 46 const base::DictionaryValue* optional_fields) OVERRIDE; | 48 NotificationDelegate* delegate) OVERRIDE; |
| 47 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; | 49 virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; |
| 48 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; | 50 virtual void RemoveAllNotifications(bool by_user) OVERRIDE; |
| 49 virtual void SetNotificationIcon(const std::string& notification_id, | 51 virtual void SetNotificationIcon(const std::string& notification_id, |
| 50 const gfx::Image& image) OVERRIDE; | 52 const gfx::Image& image) OVERRIDE; |
| 51 virtual void SetNotificationImage(const std::string& notification_id, | 53 virtual void SetNotificationImage(const std::string& notification_id, |
| 52 const gfx::Image& image) OVERRIDE; | 54 const gfx::Image& image) OVERRIDE; |
| 53 virtual void SetNotificationButtonIcon(const std::string& notification_id, | 55 virtual void SetNotificationButtonIcon(const std::string& notification_id, |
| 54 int button_index, | 56 int button_index, |
| 55 const gfx::Image& image) OVERRIDE; | 57 const gfx::Image& image) OVERRIDE; |
| 56 virtual void DisableNotificationsByExtension(const std::string& id) OVERRIDE; | 58 virtual void DisableNotificationsByExtension(const std::string& id) OVERRIDE; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 72 scoped_ptr<NotificationList> notification_list_; | 74 scoped_ptr<NotificationList> notification_list_; |
| 73 ObserverList<MessageCenterObserver> observer_list_; | 75 ObserverList<MessageCenterObserver> observer_list_; |
| 74 Delegate* delegate_; | 76 Delegate* delegate_; |
| 75 | 77 |
| 76 DISALLOW_COPY_AND_ASSIGN(MessageCenterImpl); | 78 DISALLOW_COPY_AND_ASSIGN(MessageCenterImpl); |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 } // namespace message_center | 81 } // namespace message_center |
| 80 | 82 |
| 81 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 83 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
| OLD | NEW |