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

Unified Diff: ui/message_center/views/message_popup_collection.cc

Issue 114323002: Fixes the context menu for a notification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix2 Created 7 years 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/views/message_popup_collection.h ('k') | ui/message_center/views/message_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/message_popup_collection.cc
diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc
index cc8c79b4656e72c4bc1565ac8c58dc5b8445b1b2..f7134c4c68d3114e349d2f1d2d4549bb21ce989d 100644
--- a/ui/message_center/views/message_popup_collection.cc
+++ b/ui/message_center/views/message_popup_collection.cc
@@ -23,6 +23,7 @@
#include "ui/message_center/message_center_util.h"
#include "ui/message_center/notification.h"
#include "ui/message_center/notification_list.h"
+#include "ui/message_center/views/message_view_context_menu_controller.h"
#include "ui/message_center/views/notification_view.h"
#include "ui/message_center/views/toast_contents_view.h"
#include "ui/views/background.h"
@@ -68,6 +69,7 @@ MessagePopupCollection::MessagePopupCollection(gfx::NativeView parent,
latest_toast_entered_(NULL),
user_is_closing_toasts_by_clicking_(false),
first_item_has_no_margin_(first_item_has_no_margin),
+ context_menu_controller_(new MessageViewContextMenuController(this)),
weak_factory_(this) {
DCHECK(message_center_);
defer_timer_.reset(new base::OneShotTimer<MessagePopupCollection>);
@@ -116,13 +118,10 @@ void MessagePopupCollection::RemoveNotification(
message_center_->RemoveNotification(notification_id, by_user);
}
-void MessagePopupCollection::DisableNotificationsFromThisSource(
- const NotifierId& notifier_id) {
- message_center_->DisableNotificationsByNotifier(notifier_id);
-}
-
-void MessagePopupCollection::ShowNotifierSettingsBubble() {
- tray_->ShowNotifierSettingsBubble();
+scoped_ptr<ui::MenuModel> MessagePopupCollection::CreateMenuModel(
+ const NotifierId& notifier_id,
+ const base::string16& display_source) {
+ return tray_->CreateNotificationMenuModel(notifier_id, display_source);
}
bool MessagePopupCollection::HasClickedListener(
@@ -194,6 +193,7 @@ void MessagePopupCollection::UpdateWidgets() {
*(*iter),
expanded,
true); // Create top-level notification.
+ view->set_context_menu_controller(context_menu_controller_.get());
int view_height = ToastContentsView::GetToastSizeForView(view).height();
int height_available = top_down ? work_area_.bottom() - base : base;
@@ -513,6 +513,7 @@ void MessagePopupCollection::OnNotificationUpdated(
*(*iter),
expanded,
true); // Create top-level notification.
+ view->set_context_menu_controller(context_menu_controller_.get());
(*toast_iter)->SetContents(view, a11y_feedback_for_updates);
updated = true;
}
« no previous file with comments | « ui/message_center/views/message_popup_collection.h ('k') | ui/message_center/views/message_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698