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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2671923002: mash: Cleanup ash shelf application menu code. (Closed)
Patch Set: Add 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/public/cpp/shelf_application_menu_item.cc ('k') | ash/shell/window_watcher_shelf_item_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index e2df5ffe4768fb84bb82116bbd7a39a8b82ac25d..62f000f867213554ab25b48743d329abb39a43ce 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -2004,36 +2004,6 @@ class InkDropSpy : public views::InkDrop {
DISALLOW_COPY_AND_ASSIGN(InkDropSpy);
};
-// A menu model that contains minimum number of items needed for a menu to be
-// shown on a shelf item.
-class TestShelfMenuModel : public ui::SimpleMenuModel,
- public ui::SimpleMenuModel::Delegate {
- public:
- TestShelfMenuModel() : ui::SimpleMenuModel(this) { Build(); }
- ~TestShelfMenuModel() override {}
-
- private:
- void Build() {
- // A menu is expected to have at least 6 items. Three spacing separators,
- // one title, and at least two more items.
- AddSeparator(ui::SPACING_SEPARATOR);
- AddItem(0, base::ASCIIToUTF16("Title"));
- AddSeparator(ui::SPACING_SEPARATOR);
- AddItem(1, base::ASCIIToUTF16("Item 1"));
- AddItem(2, base::ASCIIToUTF16("Item 2"));
- AddSeparator(ui::SPACING_SEPARATOR);
- }
-
- // ui::SimpleMenuModel::Delegate:
- bool IsCommandIdChecked(int command_id) const override { return false; }
- bool IsCommandIdEnabled(int command_id) const override {
- return command_id != 0;
- }
- void ExecuteCommand(int command_id, int event_flags) override {}
-
- DISALLOW_COPY_AND_ASSIGN(TestShelfMenuModel);
-};
-
// A ShelfItemDelegate that returns a menu for the shelf item.
class ListMenuShelfItemDelegate : public TestShelfItemDelegate {
public:
@@ -2042,8 +2012,12 @@ class ListMenuShelfItemDelegate : public TestShelfItemDelegate {
private:
// TestShelfItemDelegate:
- ui::SimpleMenuModel* CreateApplicationMenu(int event_flags) override {
- return new TestShelfMenuModel;
+ ShelfAppMenuItemList GetAppMenuItems(int event_flags) override {
+ ShelfAppMenuItemList items;
+ base::string16 title = base::ASCIIToUTF16("title");
+ items.push_back(base::MakeUnique<ShelfApplicationMenuItem>(title));
+ items.push_back(base::MakeUnique<ShelfApplicationMenuItem>(title));
+ return items;
}
DISALLOW_COPY_AND_ASSIGN(ListMenuShelfItemDelegate);
« no previous file with comments | « ash/public/cpp/shelf_application_menu_item.cc ('k') | ash/shell/window_watcher_shelf_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698