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 <vector> | |
tapted
2013/08/05 03:01:39
I guess the header doesn't need this any more, sin
calamity
2013/08/08 04:52:12
Done.
| |
9 | |
10 #include "ui/app_list/app_list_model.h" | |
8 #include "ui/base/models/simple_menu_model.h" | 11 #include "ui/base/models/simple_menu_model.h" |
9 | 12 |
13 namespace ui { | |
14 struct AvatarMenuItemModel; | |
15 } | |
16 | |
10 namespace app_list { | 17 namespace app_list { |
11 | 18 |
12 class AppListViewDelegate; | 19 class AppListViewDelegate; |
13 | 20 |
14 // Menu for the app list. This is shown in the top right hand corner of the | 21 // Menu for the app list. This is shown in the top right hand corner of the |
15 // app list. | 22 // app list. |
16 // TODO(benwells): We should consider moving this into Chrome. | 23 // TODO(benwells): We should consider moving this into Chrome. |
17 class AppListMenu : public ui::SimpleMenuModel::Delegate { | 24 class AppListMenu : public ui::SimpleMenuModel::Delegate { |
18 public: | 25 public: |
19 enum AppListMenuCommands { | 26 enum AppListMenuCommands { |
20 CURRENT_USER, | 27 CURRENT_USER, |
21 SHOW_SETTINGS, | 28 SHOW_SETTINGS, |
22 SHOW_HELP, | 29 SHOW_HELP, |
23 SHOW_FEEDBACK, | 30 SHOW_FEEDBACK, |
31 // |SELECT_PROFILE| must remain the last enum because values greater than | |
32 // |SELECT_PROFILE| are used to indicate a profile index. | |
33 SELECT_PROFILE, | |
24 }; | 34 }; |
25 | 35 |
26 explicit AppListMenu(AppListViewDelegate* delegate); | 36 AppListMenu( |
37 AppListViewDelegate* delegate, | |
38 const app_list::AppListModel::ProfileMenuItems& profile_menu_items); | |
tapted
2013/08/05 03:01:39
nit: doesn't need app_list::
calamity
2013/08/08 04:52:12
Done.
calamity
2013/08/08 04:52:12
Done.
| |
27 virtual ~AppListMenu(); | 39 virtual ~AppListMenu(); |
28 | 40 |
29 ui::SimpleMenuModel* menu_model() { return &menu_model_; } | 41 ui::SimpleMenuModel* menu_model() { return &menu_model_; } |
30 | 42 |
31 private: | 43 private: |
32 void InitMenu(); | 44 void InitMenu(); |
33 | 45 |
34 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 46 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
35 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 47 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
36 virtual bool GetAcceleratorForCommandId( | 48 virtual bool GetAcceleratorForCommandId( |
37 int command_id, | 49 int command_id, |
38 ui::Accelerator* accelerator) OVERRIDE; | 50 ui::Accelerator* accelerator) OVERRIDE; |
39 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 51 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
40 | 52 |
41 ui::SimpleMenuModel menu_model_; | 53 ui::SimpleMenuModel menu_model_; |
54 ui::SimpleMenuModel profiles_model_; | |
42 AppListViewDelegate* delegate_; | 55 AppListViewDelegate* delegate_; |
56 const app_list::AppListModel::ProfileMenuItems& profile_menu_items_; | |
tapted
2013/08/05 03:01:39
I don't usually see things declared this way in Ch
koz (OOO until 15th September)
2013/08/05 03:52:13
Right - this should probably be a value.
calamity
2013/08/08 04:52:12
Done.
| |
43 | 57 |
44 DISALLOW_COPY_AND_ASSIGN(AppListMenu); | 58 DISALLOW_COPY_AND_ASSIGN(AppListMenu); |
45 }; | 59 }; |
46 | 60 |
47 } // namespace app_list | 61 } // namespace app_list |
48 | 62 |
49 #endif // UI_APP_LIST_APP_LIST_MENU_H_ | 63 #endif // UI_APP_LIST_APP_LIST_MENU_H_ |
OLD | NEW |