| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APPLICATION_MENU_ITEM_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APPLICATION_MENU_ITEM_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APPLICATION_MENU_ITEM_MODEL_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APPLICATION_MENU_ITEM_MODEL_H_ |
| 7 | 7 |
| 8 #include "ash/shelf/shelf_menu_model.h" | 8 #include "ash/shelf/shelf_menu_model.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 | 11 |
| 12 class ChromeLauncherAppMenuItem; | 12 class ChromeLauncherAppMenuItem; |
| 13 | 13 |
| 14 // A list of the elements which makes up a simple menu description. | 14 // A list of the elements which makes up a simple menu description. |
| 15 typedef ScopedVector<ChromeLauncherAppMenuItem> ChromeLauncherAppMenuItems; | 15 typedef ScopedVector<ChromeLauncherAppMenuItem> ChromeLauncherAppMenuItems; |
| 16 | 16 |
| 17 // A menu model that builds the contents of a menu for a launcher item | 17 // A menu model that builds the contents of a menu for a launcher item |
| 18 // containing a list of running applications. | 18 // containing a list of running applications. |
| 19 class LauncherApplicationMenuItemModel : public ash::ShelfMenuModel, | 19 class LauncherApplicationMenuItemModel : public ash::ShelfMenuModel, |
| 20 public ui::SimpleMenuModel::Delegate { | 20 public ui::SimpleMenuModel::Delegate { |
| 21 public: | 21 public: |
| 22 explicit LauncherApplicationMenuItemModel( | 22 explicit LauncherApplicationMenuItemModel( |
| 23 ChromeLauncherAppMenuItems item_list); | 23 ChromeLauncherAppMenuItems item_list); |
| 24 virtual ~LauncherApplicationMenuItemModel(); | 24 ~LauncherApplicationMenuItemModel() override; |
| 25 | 25 |
| 26 // Overridden from ash::ShelfMenuModel: | 26 // Overridden from ash::ShelfMenuModel: |
| 27 virtual bool IsCommandActive(int command_id) const override; | 27 bool IsCommandActive(int command_id) const override; |
| 28 | 28 |
| 29 // Overridden from ui::SimpleMenuModel::Delegate: | 29 // Overridden from ui::SimpleMenuModel::Delegate: |
| 30 virtual bool IsCommandIdChecked(int command_id) const override; | 30 bool IsCommandIdChecked(int command_id) const override; |
| 31 virtual bool IsCommandIdEnabled(int command_id) const override; | 31 bool IsCommandIdEnabled(int command_id) const override; |
| 32 virtual bool GetAcceleratorForCommandId( | 32 bool GetAcceleratorForCommandId(int command_id, |
| 33 int command_id, | 33 ui::Accelerator* accelerator) override; |
| 34 ui::Accelerator* accelerator) override; | 34 void ExecuteCommand(int command_id, int event_flags) override; |
| 35 virtual void ExecuteCommand(int command_id, int event_flags) override; | |
| 36 | 35 |
| 37 private: | 36 private: |
| 38 void Build(); | 37 void Build(); |
| 39 | 38 |
| 40 // The list of menu items as returned from the launcher controller. | 39 // The list of menu items as returned from the launcher controller. |
| 41 ChromeLauncherAppMenuItems launcher_items_; | 40 ChromeLauncherAppMenuItems launcher_items_; |
| 42 | 41 |
| 43 DISALLOW_COPY_AND_ASSIGN(LauncherApplicationMenuItemModel); | 42 DISALLOW_COPY_AND_ASSIGN(LauncherApplicationMenuItemModel); |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APPLICATION_MENU_ITEM_MODEL_H
_ | 45 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APPLICATION_MENU_ITEM_MODEL_H
_ |
| OLD | NEW |