Chromium Code Reviews| Index: ui/message_center/message_center.cc |
| diff --git a/ui/message_center/message_center.cc b/ui/message_center/message_center.cc |
| index 8aeb89b0611dda4c5ff53d318605f84e9992a82f..37422abc07770de879bff2a138cea3d127e49c9b 100644 |
| --- a/ui/message_center/message_center.cc |
| +++ b/ui/message_center/message_center.cc |
| @@ -12,6 +12,9 @@ |
| namespace message_center { |
| +MessageCenter::Delegate::~Delegate() { |
| +} |
|
dharcourt
2013/03/02 02:08:02
To avoid an "undefined reference to vtable..." lin
|
| + |
| //------------------------------------------------------------------------------ |
| MessageCenter::MessageCenter() |
| : delegate_(NULL) { |
| @@ -103,15 +106,14 @@ void MessageCenter::SetNotificationButtonIcon( |
| } |
| //------------------------------------------------------------------------------ |
| -// Overridden from NotificationList::Delegate. |
| +// Overridden from NotificationChangeDelegate: |
| -void MessageCenter::SendRemoveNotification(const std::string& id, |
| - bool by_user) { |
| +void MessageCenter::RemoveNotification(const std::string& id, bool by_user) { |
| if (delegate_) |
| delegate_->NotificationRemoved(id, by_user); |
| } |
| -void MessageCenter::SendRemoveAllNotifications(bool by_user) { |
| +void MessageCenter::RemoveAllNotifications(bool by_user) { |
| if (delegate_) { |
| const NotificationList::Notifications& notifications = |
| notification_list_->GetNotifications(); |
| @@ -126,7 +128,7 @@ void MessageCenter::SendRemoveAllNotifications(bool by_user) { |
| } |
| } |
| -void MessageCenter::DisableNotificationByExtension( |
| +void MessageCenter::DisableNotificationsByExtension( |
| const std::string& id) { |
| if (delegate_) |
| delegate_->DisableExtension(id); |
| @@ -135,7 +137,7 @@ void MessageCenter::DisableNotificationByExtension( |
| notification_list_->SendRemoveNotificationsByExtension(id); |
| } |
| -void MessageCenter::DisableNotificationByUrl(const std::string& id) { |
| +void MessageCenter::DisableNotificationsByUrl(const std::string& id) { |
| if (delegate_) |
| delegate_->DisableNotificationsFromSource(id); |
| notification_list_->SendRemoveNotificationsBySource(id); |
| @@ -151,7 +153,11 @@ void MessageCenter::ShowNotificationSettingsDialog(gfx::NativeView context) { |
| delegate_->ShowSettingsDialog(context); |
| } |
| -void MessageCenter::OnNotificationClicked(const std::string& id) { |
| +void MessageCenter::OnExpanded(const std::string& id) { |
| + notification_list_->MarkNotificationAsExpanded(id); |
| +} |
| + |
| +void MessageCenter::OnClicked(const std::string& id) { |
| if (delegate_) |
| delegate_->OnClicked(id); |
| if (HasPopupNotifications()) { |
| @@ -160,10 +166,6 @@ void MessageCenter::OnNotificationClicked(const std::string& id) { |
| } |
| } |
| -void MessageCenter::OnQuietModeChanged(bool quiet_mode) { |
| - NotifyMessageCenterChanged(true); |
| -} |
| - |
| void MessageCenter::OnButtonClicked(const std::string& id, int button_index) { |
| if (delegate_) |
| delegate_->OnButtonClicked(id, button_index); |
| @@ -173,12 +175,20 @@ void MessageCenter::OnButtonClicked(const std::string& id, int button_index) { |
| } |
| } |
| -NotificationList* MessageCenter::GetNotificationList() { |
| - return notification_list_.get(); |
| +//------------------------------------------------------------------------------ |
| +// Overridden from NotificationList::Delegate: |
| + |
| +void MessageCenter::NotificationWasRemoved(const std::string& id, |
| + bool by_user) { |
| + RemoveNotification(id, by_user); |
| +} |
| + |
| +void MessageCenter::AllNotificationsWereRemoved(bool by_user) { |
| + RemoveAllNotifications(by_user); |
| } |
| -void MessageCenter::Delegate::OnButtonClicked(const std::string& id, |
| - int button_index) { |
| +void MessageCenter::OnQuietModeChanged(bool quiet_mode) { |
| + NotifyMessageCenterChanged(true); |
| } |
| //------------------------------------------------------------------------------ |