Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: ui/message_center/message_center.cc

Issue 12326091: Made notification center notifications collapsed and expandable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implemented review suggestions. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
//------------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698