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

Side by Side Diff: ash/public/cpp/shelf_application_menu_item.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
« no previous file with comments | « ash/public/cpp/BUILD.gn ('k') | ash/public/cpp/shelf_application_menu_item.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PUBLIC_CPP_SHELF_APPLICATION_MENU_ITEM_H_
6 #define ASH_PUBLIC_CPP_SHELF_APPLICATION_MENU_ITEM_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "ash/public/cpp/ash_public_export.h"
12 #include "base/macros.h"
13 #include "base/strings/string16.h"
14 #include "ui/gfx/image/image.h"
15
16 namespace ash {
17
18 // The title, icon, and execute function for shelf application menu items.
19 class ASH_PUBLIC_EXPORT ShelfApplicationMenuItem {
20 public:
21 // Creates an item with a |title| and optional |icon| (pass nullptr for none).
22 explicit ShelfApplicationMenuItem(const base::string16 title,
23 const gfx::Image* icon = nullptr);
24 virtual ~ShelfApplicationMenuItem();
25
26 // The title and icon for this menu item.
27 const base::string16& title() const { return title_; }
28 const gfx::Image& icon() const { return icon_; }
29
30 // Executes the menu item; |event_flags| can be used to check additional
31 // keyboard modifiers from the event that issued this command.
32 virtual void Execute(int event_flags);
33
34 private:
35 const base::string16 title_;
36 const gfx::Image icon_;
37
38 DISALLOW_COPY_AND_ASSIGN(ShelfApplicationMenuItem);
39 };
40
41 using ShelfAppMenuItemList =
42 std::vector<std::unique_ptr<ShelfApplicationMenuItem>>;
43
44 } // namespace ash
45
46 #endif // ASH_PUBLIC_CPP_SHELF_APPLICATION_MENU_ITEM_H_
OLDNEW
« no previous file with comments | « ash/public/cpp/BUILD.gn ('k') | ash/public/cpp/shelf_application_menu_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698