OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 UI_APP_LIST_APP_LIST_MENU_H_ | 5 #ifndef UI_APP_LIST_APP_LIST_MENU_H_ |
6 #define UI_APP_LIST_APP_LIST_MENU_H_ | 6 #define UI_APP_LIST_APP_LIST_MENU_H_ |
7 | 7 |
8 #include "ui/base/models/simple_menu_model.h" | 8 #include "ui/base/models/simple_menu_model.h" |
9 | 9 |
10 namespace app_list { | 10 namespace app_list { |
11 | 11 |
12 class AppListViewDelegate; | 12 class AppListViewDelegate; |
13 | 13 |
14 // Menu for the app list. This is shown in the top right hand corner of the | 14 // Menu for the app list. This is shown in the top right hand corner of the |
15 // app list. | 15 // app list. |
16 // TODO(benwells): We should consider moving this into Chrome. | 16 // TODO(benwells): We should consider moving this into Chrome. |
17 class AppListMenu : public ui::SimpleMenuModel::Delegate { | 17 class AppListMenu : public ui::SimpleMenuModel::Delegate { |
18 public: | 18 public: |
19 enum AppListMenuCommands { | 19 enum AppListMenuCommands { |
20 CURRENT_USER, | 20 CURRENT_USER, |
21 SHOW_SETTINGS, | 21 SHOW_SETTINGS, |
22 SHOW_HELP, | 22 SHOW_HELP, |
23 SHOW_FEEDBACK, | 23 SHOW_FEEDBACK, |
24 // |The received command id| - |SELECT_PROFILE| is the profile index | |
tapted
2013/07/29 01:59:10
nit: this comment's a bit unclear, since this seem
calamity
2013/07/30 08:42:34
Done.
| |
25 // selected. | |
26 SELECT_PROFILE, | |
24 }; | 27 }; |
25 | 28 |
26 explicit AppListMenu(AppListViewDelegate* delegate); | 29 explicit AppListMenu(AppListViewDelegate* delegate); |
27 virtual ~AppListMenu(); | 30 virtual ~AppListMenu(); |
28 | 31 |
29 ui::SimpleMenuModel* menu_model() { return &menu_model_; } | 32 ui::SimpleMenuModel* menu_model() { return &menu_model_; } |
30 | 33 |
31 private: | 34 private: |
32 void InitMenu(); | 35 void InitMenu(); |
33 | 36 |
34 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 37 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
35 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 38 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
36 virtual bool GetAcceleratorForCommandId( | 39 virtual bool GetAcceleratorForCommandId( |
37 int command_id, | 40 int command_id, |
38 ui::Accelerator* accelerator) OVERRIDE; | 41 ui::Accelerator* accelerator) OVERRIDE; |
39 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 42 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
40 | 43 |
41 ui::SimpleMenuModel menu_model_; | 44 ui::SimpleMenuModel menu_model_; |
45 ui::SimpleMenuModel profiles_model_; | |
42 AppListViewDelegate* delegate_; | 46 AppListViewDelegate* delegate_; |
43 | 47 |
44 DISALLOW_COPY_AND_ASSIGN(AppListMenu); | 48 DISALLOW_COPY_AND_ASSIGN(AppListMenu); |
45 }; | 49 }; |
46 | 50 |
47 } // namespace app_list | 51 } // namespace app_list |
48 | 52 |
49 #endif // UI_APP_LIST_APP_LIST_MENU_H_ | 53 #endif // UI_APP_LIST_APP_LIST_MENU_H_ |
OLD | NEW |