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 #include "chrome/browser/ui/profile_menu_model.h" | 5 #include "chrome/browser/ui/profile_menu_model.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/profile_info_cache.h" | 9 #include "chrome/browser/profiles/profile_info_cache.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 switch_profiles_sub_menu_model_.reset( | 156 switch_profiles_sub_menu_model_.reset( |
157 new SwitchProfileMenuModel(this, browser_)); | 157 new SwitchProfileMenuModel(this, browser_)); |
158 AddSubMenu(COMMAND_SWITCH_PROFILE_MENU, l10n_util::GetStringFUTF16( | 158 AddSubMenu(COMMAND_SWITCH_PROFILE_MENU, l10n_util::GetStringFUTF16( |
159 IDS_PROFILES_MENU, short_product_name), | 159 IDS_PROFILES_MENU, short_product_name), |
160 switch_profiles_sub_menu_model_.get()); | 160 switch_profiles_sub_menu_model_.get()); |
161 } else { | 161 } else { |
162 switch_profiles_sub_menu_model_.reset(); | 162 switch_profiles_sub_menu_model_.reset(); |
163 AddItem(COMMAND_CREATE_NEW_PROFILE, l10n_util::GetStringFUTF16( | 163 AddItem(COMMAND_CREATE_NEW_PROFILE, l10n_util::GetStringFUTF16( |
164 IDS_PROFILES_CREATE_NEW_PROFILE_OPTION, short_product_name)); | 164 IDS_PROFILES_CREATE_NEW_PROFILE_OPTION, short_product_name)); |
165 } | 165 } |
166 | |
167 AddItemWithStringId(COMMAND_DELETE_PROFILE, | |
168 IDS_PROFILES_DELETE_PROFILE); | |
169 } | 166 } |
170 | 167 |
171 ProfileMenuModel::~ProfileMenuModel() { | 168 ProfileMenuModel::~ProfileMenuModel() { |
172 } | 169 } |
173 | 170 |
174 // ui::SimpleMenuModel::Delegate implementation | 171 // ui::SimpleMenuModel::Delegate implementation |
175 bool ProfileMenuModel::IsCommandIdChecked(int command_id) const { | 172 bool ProfileMenuModel::IsCommandIdChecked(int command_id) const { |
176 return false; | 173 return false; |
177 } | 174 } |
178 | 175 |
(...skipping 14 matching lines...) Expand all Loading... |
193 void ProfileMenuModel::ExecuteCommand(int command_id) { | 190 void ProfileMenuModel::ExecuteCommand(int command_id) { |
194 switch (command_id) { | 191 switch (command_id) { |
195 case COMMAND_CUSTOMIZE_PROFILE: | 192 case COMMAND_CUSTOMIZE_PROFILE: |
196 browser_->ShowOptionsTab(chrome::kPersonalOptionsSubPage); | 193 browser_->ShowOptionsTab(chrome::kPersonalOptionsSubPage); |
197 break; | 194 break; |
198 case COMMAND_CHOOSE_AVATAR_ICON: | 195 case COMMAND_CHOOSE_AVATAR_ICON: |
199 break; | 196 break; |
200 case COMMAND_CREATE_NEW_PROFILE: | 197 case COMMAND_CREATE_NEW_PROFILE: |
201 ProfileManager::CreateMultiProfileAsync(); | 198 ProfileManager::CreateMultiProfileAsync(); |
202 break; | 199 break; |
203 case COMMAND_DELETE_PROFILE: | |
204 g_browser_process->profile_manager()->ScheduleProfileForDeletion( | |
205 browser_->profile()->GetPath()); | |
206 break; | |
207 default: | 200 default: |
208 NOTREACHED(); | 201 NOTREACHED(); |
209 break; | 202 break; |
210 } | 203 } |
211 } | 204 } |
OLD | NEW |