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..e4c37e2b0d03aa1a6431727d4f93227b5f1d5a23 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() { |
+} |
+ |
//------------------------------------------------------------------------------ |
MessageCenter::MessageCenter() |
: delegate_(NULL) { |
@@ -103,15 +106,14 @@ void MessageCenter::SetNotificationButtonIcon( |
} |
//------------------------------------------------------------------------------ |
-// Overridden from NotificationList::Delegate. |
+// Overridden from NotificationChangeObserver: |
-void MessageCenter::SendRemoveNotification(const std::string& id, |
- bool by_user) { |
+void MessageCenter::OnRemoveNotification(const std::string& id, bool by_user) { |
if (delegate_) |
delegate_->NotificationRemoved(id, by_user); |
} |
-void MessageCenter::SendRemoveAllNotifications(bool by_user) { |
+void MessageCenter::OnRemoveAllNotifications(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::OnDisableNotificationsByExtension( |
const std::string& id) { |
if (delegate_) |
delegate_->DisableExtension(id); |
@@ -135,23 +137,27 @@ void MessageCenter::DisableNotificationByExtension( |
notification_list_->SendRemoveNotificationsByExtension(id); |
} |
-void MessageCenter::DisableNotificationByUrl(const std::string& id) { |
+void MessageCenter::OnDisableNotificationsByUrl(const std::string& id) { |
if (delegate_) |
delegate_->DisableNotificationsFromSource(id); |
notification_list_->SendRemoveNotificationsBySource(id); |
} |
-void MessageCenter::ShowNotificationSettings(const std::string& id) { |
+void MessageCenter::OnShowNotificationSettings(const std::string& id) { |
if (delegate_) |
delegate_->ShowSettings(id); |
} |
-void MessageCenter::ShowNotificationSettingsDialog(gfx::NativeView context) { |
+void MessageCenter::OnShowNotificationSettingsDialog(gfx::NativeView context) { |
if (delegate_) |
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,17 @@ void MessageCenter::OnButtonClicked(const std::string& id, int button_index) { |
} |
} |
-NotificationList* MessageCenter::GetNotificationList() { |
- return notification_list_.get(); |
+//------------------------------------------------------------------------------ |
+// Overridden from NotificationList::Delegate: |
+ |
+void MessageCenter::SendRemoveNotification(const std::string& id, |
+ bool by_user) { |
+ if (delegate_) |
+ delegate_->NotificationRemoved(id, by_user); |
} |
-void MessageCenter::Delegate::OnButtonClicked(const std::string& id, |
- int button_index) { |
+void MessageCenter::OnQuietModeChanged(bool quiet_mode) { |
+ NotifyMessageCenterChanged(true); |
} |
//------------------------------------------------------------------------------ |