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

Side by Side Diff: ui/app_list/app_list_menu.h

Issue 20656002: Add profile selector menu to app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rework Created 7 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
OLDNEW
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/app_list/app_list_model.h"
8 #include "ui/base/models/simple_menu_model.h" 9 #include "ui/base/models/simple_menu_model.h"
9 10
11 namespace ui {
12 struct AvatarMenuItemModel;
13 }
14
10 namespace app_list { 15 namespace app_list {
11 16
12 class AppListViewDelegate; 17 class AppListViewDelegate;
13 18
14 // Menu for the app list. This is shown in the top right hand corner of the 19 // Menu for the app list. This is shown in the top right hand corner of the
15 // app list. 20 // app list.
16 // TODO(benwells): We should consider moving this into Chrome. 21 // TODO(benwells): We should consider moving this into Chrome.
17 class AppListMenu : public ui::SimpleMenuModel::Delegate { 22 class AppListMenu : public ui::SimpleMenuModel::Delegate {
18 public: 23 public:
19 enum AppListMenuCommands { 24 enum AppListMenuCommands {
20 CURRENT_USER, 25 CURRENT_USER,
21 SHOW_SETTINGS, 26 SHOW_SETTINGS,
22 SHOW_HELP, 27 SHOW_HELP,
23 SHOW_FEEDBACK, 28 SHOW_FEEDBACK,
29 // |SELECT_PROFILE| must remain the last enum because values greater than
30 // |SELECT_PROFILE| are used to indicate a profile index.
31 SELECT_PROFILE,
24 }; 32 };
25 33
26 explicit AppListMenu(AppListViewDelegate* delegate); 34 AppListMenu(
35 AppListViewDelegate* delegate,
36 const AppListModel::ProfileMenuItems& profile_menu_items);
27 virtual ~AppListMenu(); 37 virtual ~AppListMenu();
28 38
29 ui::SimpleMenuModel* menu_model() { return &menu_model_; } 39 ui::SimpleMenuModel* menu_model() { return &menu_model_; }
30 40
31 private: 41 private:
32 void InitMenu(); 42 void InitMenu();
33 43
34 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; 44 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
35 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; 45 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
36 virtual bool GetAcceleratorForCommandId( 46 virtual bool GetAcceleratorForCommandId(
37 int command_id, 47 int command_id,
38 ui::Accelerator* accelerator) OVERRIDE; 48 ui::Accelerator* accelerator) OVERRIDE;
39 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; 49 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
40 50
41 ui::SimpleMenuModel menu_model_; 51 ui::SimpleMenuModel menu_model_;
42 AppListViewDelegate* delegate_; 52 AppListViewDelegate* delegate_;
53 AppListModel::ProfileMenuItems profile_menu_items_;
43 54
44 DISALLOW_COPY_AND_ASSIGN(AppListMenu); 55 DISALLOW_COPY_AND_ASSIGN(AppListMenu);
45 }; 56 };
46 57
47 } // namespace app_list 58 } // namespace app_list
48 59
49 #endif // UI_APP_LIST_APP_LIST_MENU_H_ 60 #endif // UI_APP_LIST_APP_LIST_MENU_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698