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