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

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
« no previous file with comments | « ash/common/shelf/app_list_shelf_item_delegate.cc ('k') | ash/common/shelf/shelf_application_menu_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7abe8b54e247b73c86f752a0f05295dae64415d8 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,11 @@ 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|.
+ // |delegate| may be null in unit tests that do not execute commands.
ShelfApplicationMenuModel(const base::string16& title,
- ShelfAppMenuItemList items);
+ ShelfAppMenuItemList items,
+ ShelfItemDelegate* delegate);
~ShelfApplicationMenuModel() override;
// ui::SimpleMenuModel::Delegate:
@@ -50,6 +53,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);
};
« no previous file with comments | « ash/common/shelf/app_list_shelf_item_delegate.cc ('k') | ash/common/shelf/shelf_application_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698