Index: chrome/browser/profiles/avatar_menu_model.cc |
=================================================================== |
--- chrome/browser/profiles/avatar_menu_model.cc (revision 150342) |
+++ chrome/browser/profiles/avatar_menu_model.cc (working copy) |
@@ -7,6 +7,7 @@ |
#include "base/bind.h" |
#include "base/stl_util.h" |
#include "base/string_number_conversions.h" |
+#include "base/utf_string_conversions.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/profiles/avatar_menu_model_observer.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -102,7 +103,16 @@ |
} |
void AvatarMenuModel::AddNewProfile() { |
- ProfileManager::CreateMultiProfileAsync(string16(), string16()); |
+ // Temporarily generate a random icon/name pair to create the profile with |
sail
2012/08/10 18:01:14
This will break creating a new profile.
Do you re
Halli
2012/08/13 21:50:10
Shortcuts can't be generated from the avatar menu
sail
2012/08/13 22:09:36
Yea, if you really need this then you should just
Halli
2012/08/14 18:25:57
Done.
|
+ // instead of opening a dialog for creating a profile |
+ // Remove on completion of BUG 134904 |
+ ProfileManager* profile_manager = g_browser_process->profile_manager(); |
+ ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
+ size_t icon_index = cache.ChooseAvatarIconIndexForNewProfile(); |
+ |
+ g_browser_process->profile_manager()->CreateMultiProfileAsync( |
+ cache.ChooseNameForNewProfile(icon_index), |
+ ASCIIToUTF16(cache.GetDefaultAvatarIconUrl(icon_index))); |
ProfileMetrics::LogProfileAddNewUser(ProfileMetrics::ADD_NEW_USER_ICON); |
} |