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

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: Rebase, rebase, and rebase again! Created 7 years, 9 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
« no previous file with comments | « ui/message_center/message_center.h ('k') | ui/message_center/message_center.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center.cc
diff --git a/ui/message_center/message_center.cc b/ui/message_center/message_center.cc
index 29492a8102aaab6aaf28092e5bba92cd2e860ba3..9f67ecd439aa0a6ae227c329fa39dd9a58c4b3ac 100644
--- a/ui/message_center/message_center.cc
+++ b/ui/message_center/message_center.cc
@@ -36,6 +36,12 @@ void MessageCenter::Shutdown() {
}
//------------------------------------------------------------------------------
+
+MessageCenter::Delegate::~Delegate() {
+}
+
+//------------------------------------------------------------------------------
+
MessageCenter::MessageCenter()
: delegate_(NULL) {
notification_list_.reset(new NotificationList(this));
@@ -126,15 +132,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();
@@ -149,7 +154,7 @@ void MessageCenter::SendRemoveAllNotifications(bool by_user) {
}
}
-void MessageCenter::DisableNotificationByExtension(
+void MessageCenter::OnDisableNotificationsByExtension(
const std::string& id) {
if (delegate_)
delegate_->DisableExtension(id);
@@ -158,23 +163,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()) {
@@ -183,10 +192,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);
@@ -196,12 +201,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);
}
//------------------------------------------------------------------------------
« no previous file with comments | « ui/message_center/message_center.h ('k') | ui/message_center/message_center.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698