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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/case_conversion.h" | 8 #include "base/i18n/case_conversion.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 UserManager::Show(item.profile_path, | 138 UserManager::Show(item.profile_path, |
139 profiles::USER_MANAGER_NO_TUTORIAL, | 139 profiles::USER_MANAGER_NO_TUTORIAL, |
140 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 140 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
141 return; | 141 return; |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 base::FilePath path = | 145 base::FilePath path = |
146 profile_info_->GetPathOfProfileAtIndex(item.profile_index); | 146 profile_info_->GetPathOfProfileAtIndex(item.profile_index); |
147 | 147 |
148 chrome::HostDesktopType desktop_type = chrome::GetActiveDesktop(); | 148 ui::HostDesktopType desktop_type = chrome::GetActiveDesktop(); |
149 if (browser_) | 149 if (browser_) |
150 desktop_type = browser_->host_desktop_type(); | 150 desktop_type = browser_->host_desktop_type(); |
151 | 151 |
152 profiles::SwitchToProfile(path, desktop_type, always_create, | 152 profiles::SwitchToProfile(path, desktop_type, always_create, |
153 ProfileManager::CreateCallback(), | 153 ProfileManager::CreateCallback(), |
154 metric); | 154 metric); |
155 } | 155 } |
156 | 156 |
157 void AvatarMenu::AddNewProfile(ProfileMetrics::ProfileAdd type) { | 157 void AvatarMenu::AddNewProfile(ProfileMetrics::ProfileAdd type) { |
158 menu_actions_->AddNewProfile(type); | 158 menu_actions_->AddNewProfile(type); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 if (observer_) | 291 if (observer_) |
292 observer_->OnAvatarMenuChanged(this); | 292 observer_->OnAvatarMenuChanged(this); |
293 } | 293 } |
294 #endif | 294 #endif |
295 | 295 |
296 void AvatarMenu::Update() { | 296 void AvatarMenu::Update() { |
297 RebuildMenu(); | 297 RebuildMenu(); |
298 if (observer_) | 298 if (observer_) |
299 observer_->OnAvatarMenuChanged(this); | 299 observer_->OnAvatarMenuChanged(this); |
300 } | 300 } |
OLD | NEW |