| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profiles/avatar_menu.h" | 5 #include "chrome/browser/profiles/avatar_menu.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 128 } |
| 129 | 129 |
| 130 base::FilePath path = | 130 base::FilePath path = |
| 131 profile_info_->GetPathOfProfileAtIndex(item.profile_index); | 131 profile_info_->GetPathOfProfileAtIndex(item.profile_index); |
| 132 | 132 |
| 133 chrome::HostDesktopType desktop_type = chrome::GetActiveDesktop(); | 133 chrome::HostDesktopType desktop_type = chrome::GetActiveDesktop(); |
| 134 if (browser_) | 134 if (browser_) |
| 135 desktop_type = browser_->host_desktop_type(); | 135 desktop_type = browser_->host_desktop_type(); |
| 136 | 136 |
| 137 profiles::SwitchToProfile(path, desktop_type, always_create, | 137 profiles::SwitchToProfile(path, desktop_type, always_create, |
| 138 profiles::ProfileSwitchingDoneCallback(), | 138 ProfileManager::CreateCallback(), |
| 139 metric); | 139 metric); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void AvatarMenu::AddNewProfile(ProfileMetrics::ProfileAdd type) { | 142 void AvatarMenu::AddNewProfile(ProfileMetrics::ProfileAdd type) { |
| 143 menu_actions_->AddNewProfile(type); | 143 menu_actions_->AddNewProfile(type); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void AvatarMenu::EditProfile(size_t index) { | 146 void AvatarMenu::EditProfile(size_t index) { |
| 147 // Get the index in the profile cache from the menu index. | 147 // Get the index in the profile cache from the menu index. |
| 148 size_t profile_index = profile_list_->GetItemAt(index).profile_index; | 148 size_t profile_index = profile_list_->GetItemAt(index).profile_index; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 224 } |
| 225 | 225 |
| 226 void AvatarMenu::Observe(int type, | 226 void AvatarMenu::Observe(int type, |
| 227 const content::NotificationSource& source, | 227 const content::NotificationSource& source, |
| 228 const content::NotificationDetails& details) { | 228 const content::NotificationDetails& details) { |
| 229 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, type); | 229 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, type); |
| 230 RebuildMenu(); | 230 RebuildMenu(); |
| 231 if (observer_) | 231 if (observer_) |
| 232 observer_->OnAvatarMenuChanged(this); | 232 observer_->OnAvatarMenuChanged(this); |
| 233 } | 233 } |
| OLD | NEW |