Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 ShelfApplicationMenuItem(const base::string16 title, const gfx::Image* icon); | |
|
James Cook
2017/02/06 17:30:21
nit: Note that null icon means empty/no icon.
msw
2017/02/07 09:12:01
Done.
| |
| 22 virtual ~ShelfApplicationMenuItem(); | |
| 23 | |
| 24 // The title and icon for this menu item. | |
| 25 const base::string16& title() const { return title_; } | |
| 26 const gfx::Image& icon() const { return icon_; } | |
| 27 | |
| 28 // Executes the menu item; |event_flags| can be used to check additional | |
| 29 // keyboard modifiers from the event that issued this command. | |
| 30 virtual void Execute(int event_flags); | |
|
James Cook
2017/02/06 17:30:21
It seems weird to me to have code in ash/public/cp
msw
2017/02/07 09:12:01
It is currently implemented by Chrome subclasses,
| |
| 31 | |
| 32 private: | |
| 33 const base::string16 title_; | |
| 34 const gfx::Image icon_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(ShelfApplicationMenuItem); | |
| 37 }; | |
| 38 | |
| 39 using ShelfApplicationMenuItems = | |
| 40 std::vector<std::unique_ptr<ShelfApplicationMenuItem>>; | |
| 41 | |
| 42 } // namespace ash | |
| 43 | |
| 44 #endif // ASH_PUBLIC_CPP_SHELF_APPLICATION_MENU_ITEM_H_ | |
| OLD | NEW |