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

Unified Diff: ui/message_center/message_center_impl.cc

Issue 23636010: Notifications: Add cross-platform UMA: ShowMessageCenter, ShowSettings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added the hash to chromeactions.txt Created 7 years, 3 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_impl.h ('k') | ui/message_center/message_center_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center_impl.cc
diff --git a/ui/message_center/message_center_impl.cc b/ui/message_center/message_center_impl.cc
index 3188e8093bc1289d7ab6dfaab1969d02148ce838..1c23cd288754cd52ce4ab3edd28b22418129d3fe 100644
--- a/ui/message_center/message_center_impl.cc
+++ b/ui/message_center/message_center_impl.cc
@@ -6,6 +6,7 @@
#include "base/observer_list.h"
#include "ui/message_center/message_center_style.h"
+#include "ui/message_center/message_center_types.h"
#include "ui/message_center/notification.h"
#include "ui/message_center/notification_list.h"
#include "ui/message_center/notification_types.h"
@@ -194,7 +195,6 @@ void PopupTimersController::OnNotificationRemoved(const std::string& id,
MessageCenterImpl::MessageCenterImpl()
: MessageCenter(),
popup_timers_controller_(new internal::PopupTimersController(this)),
- delegate_(NULL),
settings_provider_(NULL) {
notification_list_.reset(new NotificationList());
}
@@ -211,13 +211,11 @@ void MessageCenterImpl::RemoveObserver(MessageCenterObserver* observer) {
observer_list_.RemoveObserver(observer);
}
-void MessageCenterImpl::SetDelegate(Delegate* delegate) {
- delegate_ = delegate;
-}
-
-void MessageCenterImpl::SetMessageCenterVisible(bool visible) {
+void MessageCenterImpl::SetVisibility(Visibility visibility) {
std::set<std::string> updated_ids;
- notification_list_->SetMessageCenterVisible(visible, &updated_ids);
+ notification_list_->SetMessageCenterVisible(
+ (visibility == VISIBILITY_MESSAGE_CENTER), &updated_ids);
+
for (std::set<std::string>::const_iterator iter = updated_ids.begin();
iter != updated_ids.end();
++iter) {
@@ -225,10 +223,9 @@ void MessageCenterImpl::SetMessageCenterVisible(bool visible) {
MessageCenterObserver, observer_list_, OnNotificationUpdated(*iter));
}
- if (!visible) {
- FOR_EACH_OBSERVER(
- MessageCenterObserver, observer_list_, OnNotificationCenterClosed());
- }
+ FOR_EACH_OBSERVER(MessageCenterObserver,
+ observer_list_,
+ OnCenterVisibilityChanged(visibility));
}
bool MessageCenterImpl::IsMessageCenterVisible() {
@@ -395,11 +392,6 @@ void MessageCenterImpl::DisableNotificationsByNotifier(
}
}
-void MessageCenterImpl::ShowNotificationSettings(const std::string& id) {
- if (delegate_)
- delegate_->ShowSettings(id);
-}
-
void MessageCenterImpl::ExpandNotification(const std::string& id) {
if (!HasNotification(id))
return;
« no previous file with comments | « ui/message_center/message_center_impl.h ('k') | ui/message_center/message_center_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698