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 3 // found in the LICENSE file. 4 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_ 7 8 #include "ash/launcher/launcher_delegate.h" 9 #include "base/memory/scoped_ptr.h" 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h" 11 12 // A menu model that builds the contents of a menu for a launcher item 13 // containing a list of running applications. 14 class LauncherApplicationMenuItemModel : public ash::LauncherMenuModel, 15 public ui::SimpleMenuModel::Delegate { 16 public: 17 explicit LauncherApplicationMenuItemModel( 18 ChromeLauncherAppMenuItems item_list); 19 virtual ~LauncherApplicationMenuItemModel(); 20 21 // Overridden from ash::LauncherMenuModel: 22 virtual bool IsCommandActive(int command_id) const OVERRIDE; 23 24 // Overridden from ui::SimpleMenuModel::Delegate: 25 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; 26 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; 27 virtual bool GetAcceleratorForCommandId( 28 int command_id, 29 ui::Accelerator* accelerator) OVERRIDE; 30 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; 31 32 private: 33 void Build(); 34 35 // The list of menu items as returned from the launcher controller. 36 ChromeLauncherAppMenuItems launcher_items_; 37 38 DISALLOW_COPY_AND_ASSIGN(LauncherApplicationMenuItemModel); 39 }; 40 41 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APPLICATION_MENU_ITEM_MODEL_H_ 42