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

Unified Diff: chrome/browser/profiles/avatar_menu_model.cc

Issue 10823217: Create/Delete windows profile shortcuts (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
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,21 @@
}
void AvatarMenuModel::AddNewProfile() {
- ProfileManager::CreateMultiProfileAsync(string16(), string16());
+ // Temporarily generate a random icon/name pair to create the profile with
+ // instead of opening a dialog for creating a profile
SteveT 2012/08/15 18:29:41 nit: profile -> profile.
Halli 2012/08/15 19:29:59 Done.
+ // Remove on completion of BUG 134904
SteveT 2012/08/15 18:29:41 nit: 134904 -> 134904.
Halli 2012/08/15 19:29:59 Done.
+ if (ProfileShortcutManager::IsFeatureEnabled()) {
+ 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)));
+ } else {
+ ProfileManager::CreateMultiProfileAsync(string16(), string16());
+ }
+
ProfileMetrics::LogProfileAddNewUser(ProfileMetrics::ADD_NEW_USER_ICON);
}

Powered by Google App Engine
This is Rietveld 408576698