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

Side by Side Diff: ash/common/shelf/shelf_application_menu_model.h

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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_COMMON_SHELF_SHELF_APPLICATION_MENU_MODEL_H_
6 #define ASH_COMMON_SHELF_SHELF_APPLICATION_MENU_MODEL_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "ash/ash_export.h"
12 #include "ash/public/cpp/shelf_application_menu_item.h"
13 #include "base/macros.h"
14 #include "ui/base/models/simple_menu_model.h"
15
16 class ShelfApplicationMenuModelTestAPI;
17
18 namespace ash {
19
20 // A menu model listing open applications associated with a shelf item. Layout:
21 // +---------------------------+
22 // | |
23 // | App Title |
24 // | |
25 // | [Icon] Item Title |
26 // | [Icon] Item Title |
27 // | |
28 // +---------------------------+
29 class ASH_EXPORT ShelfApplicationMenuModel
30 : public ui::SimpleMenuModel,
31 public ui::SimpleMenuModel::Delegate {
32 public:
33 // Makes a menu with a |title|, separators, and the specified |items|.
34 ShelfApplicationMenuModel(const base::string16& title,
35 ShelfAppMenuItemList items);
36 ~ShelfApplicationMenuModel() override;
37
38 // ui::SimpleMenuModel::Delegate:
39 bool IsCommandIdChecked(int command_id) const override;
40 bool IsCommandIdEnabled(int command_id) const override;
41 void ExecuteCommand(int command_id, int event_flags) override;
42
43 private:
44 friend class ShelfApplicationMenuModelTestAPI;
45
46 // Records UMA metrics when a menu item is selected.
47 void RecordMenuItemSelectedMetrics(int command_id,
48 int num_menu_items_enabled);
49
50 // The list of menu items as returned from the shelf item's controller.
51 ShelfAppMenuItemList items_;
52
53 DISALLOW_COPY_AND_ASSIGN(ShelfApplicationMenuModel);
54 };
55
56 } // namespace ash
57
58 #endif // ASH_COMMON_SHELF_SHELF_APPLICATION_MENU_MODEL_H_
OLDNEW
« 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