OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_UI_PROFILE_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_PROFILE_MENU_MODEL_H_ |
6 #define CHROME_BROWSER_UI_PROFILE_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_UI_PROFILE_MENU_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/models/simple_menu_model.h" | 9 #include "ui/base/models/simple_menu_model.h" |
10 | 10 |
11 class Browser; | 11 class Browser; |
12 | 12 |
13 // Menu for the multi-profile button displayed on the browser frame. | 13 // Menu for the multi-profile button displayed on the browser frame. |
14 class ProfileMenuModel : public ui::SimpleMenuModel, | 14 class ProfileMenuModel : public ui::SimpleMenuModel, |
15 public ui::SimpleMenuModel::Delegate { | 15 public ui::SimpleMenuModel::Delegate { |
16 public: | 16 public: |
17 enum { | 17 enum { |
18 COMMAND_PROFILE_NAME, | 18 COMMAND_PROFILE_NAME, |
19 COMMAND_CHOOSE_AVATAR_ICON, | 19 COMMAND_CHOOSE_AVATAR_ICON, |
20 COMMAND_CUSTOMIZE_PROFILE, | 20 COMMAND_CUSTOMIZE_PROFILE, |
21 COMMAND_DELETE_PROFILE, | |
22 COMMAND_CREATE_NEW_PROFILE, | 21 COMMAND_CREATE_NEW_PROFILE, |
23 COMMAND_SWITCH_PROFILE_MENU, | 22 COMMAND_SWITCH_PROFILE_MENU, |
24 // The profiles submenu contains a menu item for each profile. For the i'th | 23 // The profiles submenu contains a menu item for each profile. For the i'th |
25 // profile the command ID is COMMAND_SWITCH_TO_PROFILE + i. Since there can | 24 // profile the command ID is COMMAND_SWITCH_TO_PROFILE + i. Since there can |
26 // be any number of profiles this must be the last command id. | 25 // be any number of profiles this must be the last command id. |
27 COMMAND_SWITCH_TO_PROFILE, | 26 COMMAND_SWITCH_TO_PROFILE, |
28 }; | 27 }; |
29 | 28 |
30 explicit ProfileMenuModel(Browser* browser); | 29 explicit ProfileMenuModel(Browser* browser); |
31 virtual ~ProfileMenuModel(); | 30 virtual ~ProfileMenuModel(); |
32 | 31 |
33 // ui::SimpleMenuModel::Delegate implementation | 32 // ui::SimpleMenuModel::Delegate implementation |
34 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 33 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
35 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 34 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
36 virtual bool GetAcceleratorForCommandId( | 35 virtual bool GetAcceleratorForCommandId( |
37 int command_id, ui::Accelerator* accelerator) OVERRIDE; | 36 int command_id, ui::Accelerator* accelerator) OVERRIDE; |
38 virtual void ExecuteCommand(int command_id) OVERRIDE; | 37 virtual void ExecuteCommand(int command_id) OVERRIDE; |
39 | 38 |
40 private: | 39 private: |
41 Browser* browser_; | 40 Browser* browser_; |
42 scoped_ptr<ui::SimpleMenuModel> switch_profiles_sub_menu_model_; | 41 scoped_ptr<ui::SimpleMenuModel> switch_profiles_sub_menu_model_; |
43 | 42 |
44 DISALLOW_COPY_AND_ASSIGN(ProfileMenuModel); | 43 DISALLOW_COPY_AND_ASSIGN(ProfileMenuModel); |
45 }; | 44 }; |
46 | 45 |
47 #endif // CHROME_BROWSER_UI_PROFILE_MENU_MODEL_H_ | 46 #endif // CHROME_BROWSER_UI_PROFILE_MENU_MODEL_H_ |
OLD | NEW |