summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles/avatar_menu_model.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/profiles/avatar_menu_model.cc')
-rw-r--r--chrome/browser/profiles/avatar_menu_model.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/profiles/avatar_menu_model.cc b/chrome/browser/profiles/avatar_menu_model.cc
index f05dd2f..4a86e7f 100644
--- a/chrome/browser/profiles/avatar_menu_model.cc
+++ b/chrome/browser/profiles/avatar_menu_model.cc
@@ -192,6 +192,18 @@ base::FilePath AvatarMenuModel::GetProfilePath(size_t index) {
return profile_info_->GetPathOfProfileAtIndex(item.model_index);
}
+// static
+void AvatarMenuModel::SwitchToGuestProfileWindow(Browser* browser) {
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ profile_manager->CreateProfileAsync(ProfileManager::GetGuestProfilePath(),
+ base::Bind(&OnProfileCreated,
+ false,
+ browser->host_desktop_type()),
+ string16(),
+ string16(),
+ false);
+}
+
size_t AvatarMenuModel::GetNumberOfItems() {
return items_.size();
}
@@ -272,9 +284,12 @@ bool AvatarMenuModel::ShouldShowAvatarMenu() {
DCHECK(ProfileManager::IsMultipleProfilesEnabled());
return true;
}
- return ProfileManager::IsMultipleProfilesEnabled() &&
- g_browser_process->profile_manager() &&
- g_browser_process->profile_manager()->GetNumberOfProfiles() > 1;
+ if (ProfileManager::IsMultipleProfilesEnabled()) {
+ return ProfileManager::IsNewProfileManagementEnabled() ||
+ (g_browser_process->profile_manager() &&
+ g_browser_process->profile_manager()->GetNumberOfProfiles() > 1);
+ }
+ return false;
}
void AvatarMenuModel::RebuildMenu() {