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

Unified Diff: ui/message_center/message_center_tray.h

Issue 114323002: Fixes the context menu for a notification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: ui/message_center/message_center_tray.h
diff --git a/ui/message_center/message_center_tray.h b/ui/message_center/message_center_tray.h
index fed4eb1433711376aba9bd922a1df8efd472ef37..a496b3248796db448e4bb16664f466fc735b0f7e 100644
--- a/ui/message_center/message_center_tray.h
+++ b/ui/message_center/message_center_tray.h
@@ -6,6 +6,7 @@
#define UI_MESSAGE_CENTER_MESSAGE_CENTER_TRAY_H_
#include "base/observer_list.h"
+#include "ui/base/models/simple_menu_model.h"
#include "ui/message_center/message_center_export.h"
#include "ui/message_center/message_center_observer.h"
#include "ui/message_center/message_center_tray_delegate.h"
@@ -15,6 +16,7 @@ namespace message_center {
class MessageCenter;
class MessageBubbleBase;
class MessagePopupBubble;
+class Notification;
class QuietModeBubble;
// Implementation found with each supported platform's implementation of
@@ -24,7 +26,9 @@ MessageCenterTrayDelegate* CreateMessageCenterTray();
// Class that observes a MessageCenter. Manages the popup and message center
// bubbles. Tells the MessageCenterTrayHost when the tray is changed, as well
// as when bubbles are shown and hidden.
-class MESSAGE_CENTER_EXPORT MessageCenterTray : public MessageCenterObserver {
+class MESSAGE_CENTER_EXPORT MessageCenterTray
+ : public MessageCenterObserver,
+ public ui::SimpleMenuModel::Delegate {
public:
MessageCenterTray(MessageCenterTrayDelegate* delegate,
message_center::MessageCenter* message_center);
@@ -54,6 +58,10 @@ class MESSAGE_CENTER_EXPORT MessageCenterTray : public MessageCenterObserver {
// Toggles the visibility of the settings view in the message center bubble.
void ShowNotifierSettingsBubble();
+ // Creates a new model of the context menu for the notification of |id|.
+ scoped_ptr<ui::MenuModel> CreateMenuModelForNotification(
+ const std::string& id);
+
bool message_center_visible() { return message_center_visible_; }
bool popups_visible() { return popups_visible_; }
MessageCenterTrayDelegate* delegate() { return delegate_; }
@@ -78,6 +86,15 @@ class MESSAGE_CENTER_EXPORT MessageCenterTray : public MessageCenterObserver {
virtual void OnQuietModeChanged(bool in_quiet_mode) OVERRIDE;
virtual void OnBlockingStateChanged(NotificationBlocker* blocker) OVERRIDE;
+ // Overridden from ui::SimpleMenuModel::Delegate:
+ virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool GetAcceleratorForCommandId(
+ int command_id,
+ ui::Accelerator* accelerator) OVERRIDE;
+ virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+ virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE;
+
private:
void OnMessageCenterChanged();
void NotifyMessageCenterTrayChanged();
@@ -91,6 +108,9 @@ class MESSAGE_CENTER_EXPORT MessageCenterTray : public MessageCenterObserver {
// |delegate_| is a weak pointer that must live longer than MessageCenterTray.
MessageCenterTrayDelegate* delegate_;
+ // The notification for the current context menu.
+ Notification* context_menu_notification_;
+
DISALLOW_COPY_AND_ASSIGN(MessageCenterTray);
};

Powered by Google App Engine
This is Rietveld 408576698