| 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_SHELL_CONTEXT_MENU_H_ | 5 #ifndef ASH_SHELL_CONTEXT_MENU_H_ |
| 6 #define ASH_SHELL_CONTEXT_MENU_H_ | 6 #define ASH_SHELL_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include "ash/shelf/shelf_alignment_menu.h" | 8 #include "ash/shelf/shelf_alignment_menu.h" |
| 9 #include "ash/shelf/shelf_types.h" | |
| 10 #include "base/macros.h" | 9 #include "base/macros.h" |
| 11 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
| 12 | 11 |
| 13 namespace aura { | 12 namespace ash { |
| 14 class RootWindow; | |
| 15 } | |
| 16 | 13 |
| 17 namespace ash { | 14 class Shelf; |
| 15 |
| 18 namespace shell { | 16 namespace shell { |
| 19 | 17 |
| 20 // Context menu for the ash_shell. | 18 // Context menu for the ash shell. |
| 21 class ContextMenu : public ui::SimpleMenuModel, | 19 class ContextMenu : public ui::SimpleMenuModel, |
| 22 public ui::SimpleMenuModel::Delegate { | 20 public ui::SimpleMenuModel::Delegate { |
| 23 public: | 21 public: |
| 24 explicit ContextMenu(aura::Window* root); | 22 explicit ContextMenu(Shelf* shelf); |
| 25 ~ContextMenu() override; | 23 ~ContextMenu() override; |
| 26 | 24 |
| 27 // ui::SimpleMenuModel::Delegate overrides: | 25 // ui::SimpleMenuModel::Delegate overrides: |
| 28 bool IsCommandIdChecked(int command_id) const override; | 26 bool IsCommandIdChecked(int command_id) const override; |
| 29 bool IsCommandIdEnabled(int command_id) const override; | 27 bool IsCommandIdEnabled(int command_id) const override; |
| 30 bool GetAcceleratorForCommandId(int command_id, | 28 bool GetAcceleratorForCommandId(int command_id, |
| 31 ui::Accelerator* accelerator) override; | 29 ui::Accelerator* accelerator) override; |
| 32 void ExecuteCommand(int command_id, int event_flags) override; | 30 void ExecuteCommand(int command_id, int event_flags) override; |
| 33 | 31 |
| 34 private: | 32 private: |
| 35 enum MenuItem { | 33 enum MenuItem { |
| 36 MENU_AUTO_HIDE, | 34 MENU_AUTO_HIDE, |
| 37 MENU_ALIGNMENT_MENU, | 35 MENU_ALIGNMENT_MENU, |
| 38 }; | 36 }; |
| 39 | 37 |
| 40 aura::Window* root_window_; | 38 Shelf* shelf_; |
| 41 | |
| 42 ShelfAlignmentMenu alignment_menu_; | 39 ShelfAlignmentMenu alignment_menu_; |
| 43 | 40 |
| 44 DISALLOW_COPY_AND_ASSIGN(ContextMenu); | 41 DISALLOW_COPY_AND_ASSIGN(ContextMenu); |
| 45 }; | 42 }; |
| 46 | 43 |
| 47 } // namespace shell | 44 } // namespace shell |
| 48 } // namespace ash | 45 } // namespace ash |
| 49 | 46 |
| 50 #endif // ASH_SHELL_CONTEXT_MENU_H_ | 47 #endif // ASH_SHELL_CONTEXT_MENU_H_ |
| OLD | NEW |