OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 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_SHELF_SHELF_ITEM_CONTEXT_MENU_H_ | |
6 #define ASH_SHELF_SHELF_ITEM_CONTEXT_MENU_H_ | |
7 | |
8 #include "ash/shelf/shelf_alignment_menu.h" | |
9 #include "base/basictypes.h" | |
10 #include "base/compiler_specific.h" | |
11 | |
12 namespace aura { | |
13 class Window; | |
14 } | |
15 | |
16 namespace ash { | |
17 | |
18 class Shell; | |
19 | |
20 namespace internal { | |
21 | |
22 class ShelfWindowWatcherItemDelegate; | |
23 | |
24 // Context menu shown for an item created by ShelfWindowWatcher. | |
25 class ShelfItemContextMenu : public ui::SimpleMenuModel, | |
26 public ui::SimpleMenuModel::Delegate { | |
27 public: | |
28 ShelfItemContextMenu(ShelfWindowWatcherItemDelegate* item_delegate, | |
29 aura::Window* root_window); | |
30 | |
31 virtual ~ShelfItemContextMenu(); | |
32 | |
33 void Init(); | |
34 | |
35 // ui::SimpleMenuModel::Delegate overrides: | |
36 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | |
37 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | |
38 virtual bool GetAcceleratorForCommandId( | |
39 int command_id, | |
40 ui::Accelerator* accelerator) OVERRIDE; | |
41 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | |
42 | |
43 private: | |
44 enum MenuItem { | |
45 MENU_CLOSE, | |
46 MENU_AUTO_HIDE, | |
47 MENU_ALIGNMENT_MENU, | |
48 #if defined(OS_CHROMEOS) | |
49 MENU_CHANGE_WALLPAPER, | |
50 #endif | |
51 }; | |
52 | |
53 // Returns true if there is a full screen window. | |
54 bool IsFullScreenMode() const; | |
55 | |
56 // Toggles ShelfAutoHideBehavior. | |
57 void ToggleShelfAutoHideBehavior() const; | |
58 | |
59 // Owned by ShelfItemDelegateManager. | |
60 ShelfWindowWatcherItemDelegate* item_delegate_; | |
61 | |
62 // Not owned. | |
63 aura::Window* root_window_; | |
64 ash::Shell* shell_; | |
sky
2013/12/16 21:09:44
Why not use Shell::GetInstance() instead of cachin
| |
65 | |
66 ash::ShelfAlignmentMenu shelf_alignment_menu_; | |
67 | |
68 DISALLOW_COPY_AND_ASSIGN(ShelfItemContextMenu); | |
69 }; | |
70 | |
71 } // namespace internal | |
72 } // namespace ash | |
73 | |
74 #endif // ASH_SHELF_SHELF_ITEM_CONTEXT_MENU_H_ | |
OLD | NEW |