| 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   // 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_ | 
| OLD | NEW |