Chromium Code Reviews| Index: ui/message_center/message_center.h |
| diff --git a/ui/message_center/message_center.h b/ui/message_center/message_center.h |
| index 7cc49daa96344396bfcc59e742d36e94dcb0d252..e6ce7bb695aecc01ea21c55d04330132fed667ed 100644 |
| --- a/ui/message_center/message_center.h |
| +++ b/ui/message_center/message_center.h |
| @@ -11,6 +11,7 @@ |
| #include "base/observer_list.h" |
| #include "ui/gfx/native_widget_types.h" |
| #include "ui/message_center/message_center_export.h" |
| +#include "ui/message_center/notification_change_delegate.h" |
| #include "ui/message_center/notification_list.h" |
| #include "ui/message_center/notification_types.h" |
| @@ -28,7 +29,8 @@ class DictionaryValue; |
| namespace message_center { |
| -class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationList::Delegate { |
| +class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationChangeDelegate, |
| + public NotificationList::Delegate { |
| public: |
| // Class that hosts the message center. |
| class MESSAGE_CENTER_EXPORT Observer { |
| @@ -42,6 +44,8 @@ class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationList::Delegate { |
| class MESSAGE_CENTER_EXPORT Delegate { |
| public: |
| + virtual ~Delegate(); |
| + |
| // Called when the notification associated with |notification_id| is |
| // removed (i.e. closed by the user). |
| virtual void NotificationRemoved(const std::string& notification_id, |
| @@ -72,10 +76,7 @@ class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationList::Delegate { |
| // TODO(miket): consider providing default implementations for the pure |
| // virtuals above, to avoid changing so many files in disparate parts of |
| // the codebase each time we enhance this interface. |
| - virtual void OnButtonClicked(const std::string& id, int button_index); |
| - |
| - protected: |
| - virtual ~Delegate() {} |
| + virtual void OnButtonClicked(const std::string& id, int button_index) = 0; |
| }; |
| MessageCenter(); |
| @@ -139,19 +140,23 @@ class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationList::Delegate { |
| NotificationList* notification_list() { return notification_list_.get(); } |
| bool quiet_mode() const { return notification_list_->quiet_mode(); } |
| - // Overridden from NotificationList::Delegate. |
| - virtual void SendRemoveNotification(const std::string& id, |
| - bool by_user) OVERRIDE; |
| - virtual void SendRemoveAllNotifications(bool by_user) OVERRIDE; |
| - virtual void DisableNotificationByExtension(const std::string& id) OVERRIDE; |
| - virtual void DisableNotificationByUrl(const std::string& id) OVERRIDE; |
| + // Overridden from NotificationChangeDelegate: |
| + virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE; |
| + virtual void RemoveAllNotifications(bool by_user) OVERRIDE; |
| + virtual void DisableNotificationsByExtension(const std::string& id) OVERRIDE; |
| + virtual void DisableNotificationsByUrl(const std::string& id) OVERRIDE; |
| virtual void ShowNotificationSettings(const std::string& id) OVERRIDE; |
| virtual void ShowNotificationSettingsDialog(gfx::NativeView context) OVERRIDE; |
| - virtual void OnNotificationClicked(const std::string& id) OVERRIDE; |
| - virtual void OnQuietModeChanged(bool quiet_mode) OVERRIDE; |
| + virtual void OnExpanded(const std::string& id) OVERRIDE; |
| + virtual void OnClicked(const std::string& id) OVERRIDE; |
| virtual void OnButtonClicked(const std::string& id, int button_index) |
| OVERRIDE; |
| - virtual NotificationList* GetNotificationList() OVERRIDE; |
| + |
| + // Overridden from NotificationList::Delegate: |
| + virtual void NotificationWasRemoved(const std::string& id, |
| + bool by_user) OVERRIDE; |
| + virtual void AllNotificationsWereRemoved(bool by_user) OVERRIDE; |
|
dharcourt
2013/03/04 21:17:52
It turned out no one was using this so I pruned it
|
| + virtual void OnQuietModeChanged(bool quiet_mode) OVERRIDE; |
| private: |
| // Calls OnMessageCenterChanged on each observer. |