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

Side by Side Diff: ash/public/cpp/shelf_application_menu_item.h

Issue 2718563008: mash: Use mojo for ShelfItemDelegate and [app] MenuItem. (Closed)
Patch Set: Address comments. Created 3 years, 9 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_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 command id, title, and icon for shelf application menu items.
19 class ASH_PUBLIC_EXPORT ShelfApplicationMenuItem {
20 public:
21 // Creates an item with a client-specific |command_id|, a |title|, and an
22 // optional |icon| (pass nullptr for no icon).
23 ShelfApplicationMenuItem(uint32_t command_id,
24 const base::string16& title,
25 const gfx::Image* icon = nullptr);
26 ~ShelfApplicationMenuItem();
27
28 // The title and icon for this menu item.
29 uint32_t command_id() const { return command_id_; }
30 const base::string16& title() const { return title_; }
31 const gfx::Image& icon() const { return icon_; }
32
33 private:
34 const uint32_t command_id_;
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

Powered by Google App Engine
This is Rietveld 408576698