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

Unified Diff: ash/common/shelf/shelf_application_menu_model.h

Issue 2716403005: mash: Remove shelf app menu item objects. (Closed)
Patch Set: Address comments. Created 3 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: ash/common/shelf/shelf_application_menu_model.h
diff --git a/ash/common/shelf/shelf_application_menu_model.h b/ash/common/shelf/shelf_application_menu_model.h
index ff865fe83f2236c3a4dc3decba89665b27afbc50..0e466306d4b15391f71b7d0def9063e435ac6fdf 100644
--- a/ash/common/shelf/shelf_application_menu_model.h
+++ b/ash/common/shelf/shelf_application_menu_model.h
@@ -13,10 +13,11 @@
#include "base/macros.h"
#include "ui/base/models/simple_menu_model.h"
-class ShelfApplicationMenuModelTestAPI;
-
namespace ash {
+class ShelfApplicationMenuModelTestAPI;
+class ShelfItemDelegate;
+
// A menu model listing open applications associated with a shelf item. Layout:
// +---------------------------+
// | |
@@ -30,9 +31,10 @@ class ASH_EXPORT ShelfApplicationMenuModel
: public ui::SimpleMenuModel,
public ui::SimpleMenuModel::Delegate {
public:
- // Makes a menu with a |title|, separators, and the specified |items|.
+ // Makes a menu with a |title|, separators, and |items| for |delegate|.
ShelfApplicationMenuModel(const base::string16& title,
- ShelfAppMenuItemList items);
+ ShelfAppMenuItemList items,
+ ShelfItemDelegate* delegate);
~ShelfApplicationMenuModel() override;
// ui::SimpleMenuModel::Delegate:
@@ -50,6 +52,9 @@ class ASH_EXPORT ShelfApplicationMenuModel
// The list of menu items as returned from the shelf item's controller.
ShelfAppMenuItemList items_;
+ // The shelf item delegate that created the menu and executes its commands.
+ ShelfItemDelegate* delegate_;
+
DISALLOW_COPY_AND_ASSIGN(ShelfApplicationMenuModel);
};

Powered by Google App Engine
This is Rietveld 408576698