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 ASH_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 5 #ifndef ASH_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
6 #define ASH_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 6 #define ASH_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/wm/shelf_auto_hide_behavior.h" |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "ui/base/models/simple_menu_model.h" | 12 #include "ui/base/models/simple_menu_model.h" |
12 | 13 |
13 namespace ash { | 14 namespace ash { |
14 | 15 |
15 // Context menu for the launcher. | 16 // Context menu for the launcher. |
16 class ASH_EXPORT LauncherContextMenu : public ui::SimpleMenuModel, | 17 class ASH_EXPORT LauncherContextMenu : public ui::SimpleMenuModel, |
17 public ui::SimpleMenuModel::Delegate { | 18 public ui::SimpleMenuModel::Delegate { |
18 public: | 19 public: |
19 LauncherContextMenu(); | 20 LauncherContextMenu(); |
20 virtual ~LauncherContextMenu(); | 21 virtual ~LauncherContextMenu(); |
21 | 22 |
22 // Returns true if the auto-hide menu item is checked. | 23 // Returns true if the auto-hide menu item is checked. |
23 static bool IsAutoHideMenuHideChecked(); | 24 static bool IsAutoHideMenuHideChecked(); |
24 | 25 |
25 // Toggles the state of the auto-hide menu item. | 26 // Returns the toggled state of the auto-hide behavior. |
26 static void ToggleAutoHideMenu(); | 27 static ShelfAutoHideBehavior GetToggledAutoHideBehavior(); |
27 | 28 |
28 // Returns the resource id for the auto-hide menu. | 29 // Returns the resource id for the auto-hide menu. |
29 static int GetAutoHideResourceStringId(); | 30 static int GetAutoHideResourceStringId(); |
30 | 31 |
31 // ui::SimpleMenuModel::Delegate overrides: | 32 // ui::SimpleMenuModel::Delegate overrides: |
32 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 33 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
33 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 34 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
34 virtual bool GetAcceleratorForCommandId( | 35 virtual bool GetAcceleratorForCommandId( |
35 int command_id, | 36 int command_id, |
36 ui::Accelerator* accelerator) OVERRIDE; | 37 ui::Accelerator* accelerator) OVERRIDE; |
37 virtual void ExecuteCommand(int command_id) OVERRIDE; | 38 virtual void ExecuteCommand(int command_id) OVERRIDE; |
38 | 39 |
39 private: | 40 private: |
40 enum MenuItem { | 41 enum MenuItem { |
41 MENU_AUTO_HIDE, | 42 MENU_AUTO_HIDE, |
42 }; | 43 }; |
43 | 44 |
44 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); | 45 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); |
45 }; | 46 }; |
46 | 47 |
47 } // namespace ash | 48 } // namespace ash |
48 | 49 |
49 #endif // ASH_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 50 #endif // ASH_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
OLD | NEW |