| OLD | NEW |
| (Empty) |
| 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_VIEWS_AURA_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ash/launcher/launcher_types.h" | |
| 10 #include "base/basictypes.h" | |
| 11 #include "ui/base/models/simple_menu_model.h" | |
| 12 | |
| 13 namespace gfx { | |
| 14 class Point; | |
| 15 } | |
| 16 | |
| 17 namespace views { | |
| 18 class MenuRunner; | |
| 19 class View; | |
| 20 } | |
| 21 | |
| 22 class ChromeLauncherDelegate; | |
| 23 | |
| 24 // Context menu shown for a launcher item. | |
| 25 class LauncherContextMenu : public ui::SimpleMenuModel, | |
| 26 public ui::SimpleMenuModel::Delegate { | |
| 27 public: | |
| 28 LauncherContextMenu(ChromeLauncherDelegate* delegate, ash::LauncherID id); | |
| 29 virtual ~LauncherContextMenu(); | |
| 30 | |
| 31 // ID of the item we're showing the context menu for. | |
| 32 ash::LauncherID id() const { return id_; } | |
| 33 | |
| 34 // ui::SimpleMenuModel::Delegate overrides: | |
| 35 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | |
| 36 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | |
| 37 virtual bool GetAcceleratorForCommandId( | |
| 38 int command_id, | |
| 39 ui::Accelerator* accelerator) OVERRIDE; | |
| 40 virtual void ExecuteCommand(int command_id) OVERRIDE; | |
| 41 | |
| 42 private: | |
| 43 enum MenuItem { | |
| 44 MENU_OPEN, | |
| 45 MENU_PIN, | |
| 46 MENU_CLOSE | |
| 47 }; | |
| 48 | |
| 49 ChromeLauncherDelegate* delegate_; | |
| 50 const ash::LauncherID id_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | |
| OLD | NEW |