Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Side by Side Diff: ash/shell/context_menu.h

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | ash/shell/context_menu.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | ash/shell/context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698