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> | |
9 | |
8 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
9 | 11 |
12 namespace ui { | |
13 struct AvatarMenuItemModel; | |
14 } | |
15 | |
10 namespace app_list { | 16 namespace app_list { |
11 | 17 |
12 class AppListViewDelegate; | 18 class AppListViewDelegate; |
13 | 19 |
14 // Menu for the app list. This is shown in the top right hand corner of the | 20 // Menu for the app list. This is shown in the top right hand corner of the |
15 // app list. | 21 // app list. |
16 // TODO(benwells): We should consider moving this into Chrome. | 22 // TODO(benwells): We should consider moving this into Chrome. |
17 class AppListMenu : public ui::SimpleMenuModel::Delegate { | 23 class AppListMenu : public ui::SimpleMenuModel::Delegate { |
18 public: | 24 public: |
19 enum AppListMenuCommands { | 25 enum AppListMenuCommands { |
20 CURRENT_USER, | 26 CURRENT_USER, |
21 SHOW_SETTINGS, | 27 SHOW_SETTINGS, |
22 SHOW_HELP, | 28 SHOW_HELP, |
23 SHOW_FEEDBACK, | 29 SHOW_FEEDBACK, |
30 // |SELECT_PROFILE| must remain the last enum because values greater than | |
31 // |SELECT_PROFILE| are used to indicate a profile index. | |
32 SELECT_PROFILE, | |
24 }; | 33 }; |
25 | 34 |
26 explicit AppListMenu(AppListViewDelegate* delegate); | 35 explicit AppListMenu( |
tapted
2013/07/31 05:43:53
nit: explicit not needed
calamity
2013/08/01 08:35:45
Done.
| |
36 AppListViewDelegate* delegate, | |
37 std::vector<ui::AvatarMenuItemModel*>& avatar_menu_items); | |
tapted
2013/07/31 05:43:53
can't pass a non-const reference in Chrome
tapted
2013/07/31 05:43:53
I think it's convention in the current app list mo
calamity
2013/08/01 08:35:45
Done.
calamity
2013/08/01 08:35:45
Done.
| |
27 virtual ~AppListMenu(); | 38 virtual ~AppListMenu(); |
28 | 39 |
29 ui::SimpleMenuModel* menu_model() { return &menu_model_; } | 40 ui::SimpleMenuModel* menu_model() { return &menu_model_; } |
30 | 41 |
31 private: | 42 private: |
32 void InitMenu(); | 43 void InitMenu(std::vector<ui::AvatarMenuItemModel*>& avatar_menu_items); |
33 | 44 |
34 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 45 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
35 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 46 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
36 virtual bool GetAcceleratorForCommandId( | 47 virtual bool GetAcceleratorForCommandId( |
37 int command_id, | 48 int command_id, |
38 ui::Accelerator* accelerator) OVERRIDE; | 49 ui::Accelerator* accelerator) OVERRIDE; |
39 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 50 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
40 | 51 |
41 ui::SimpleMenuModel menu_model_; | 52 ui::SimpleMenuModel menu_model_; |
53 ui::SimpleMenuModel profiles_model_; | |
42 AppListViewDelegate* delegate_; | 54 AppListViewDelegate* delegate_; |
43 | 55 |
44 DISALLOW_COPY_AND_ASSIGN(AppListMenu); | 56 DISALLOW_COPY_AND_ASSIGN(AppListMenu); |
45 }; | 57 }; |
46 | 58 |
47 } // namespace app_list | 59 } // namespace app_list |
48 | 60 |
49 #endif // UI_APP_LIST_APP_LIST_MENU_H_ | 61 #endif // UI_APP_LIST_APP_LIST_MENU_H_ |
OLD | NEW |