| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profile_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 desktop_type), | 303 desktop_type), |
| 304 base::string16(), | 304 base::string16(), |
| 305 base::string16(), | 305 base::string16(), |
| 306 std::string()); | 306 std::string()); |
| 307 } | 307 } |
| 308 | 308 |
| 309 bool HasProfileSwitchTargets(Profile* profile) { | 309 bool HasProfileSwitchTargets(Profile* profile) { |
| 310 size_t min_profiles = profile->IsGuestSession() ? 1 : 2; | 310 size_t min_profiles = profile->IsGuestSession() ? 1 : 2; |
| 311 size_t number_of_profiles = | 311 size_t number_of_profiles = |
| 312 g_browser_process->profile_manager()->GetNumberOfProfiles(); | 312 g_browser_process->profile_manager()->GetNumberOfProfiles(); |
| 313 return number_of_profiles < min_profiles; | 313 return number_of_profiles >= min_profiles; |
| 314 } | 314 } |
| 315 | 315 |
| 316 void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type, | 316 void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type, |
| 317 ProfileManager::CreateCallback callback, | 317 ProfileManager::CreateCallback callback, |
| 318 ProfileMetrics::ProfileAdd metric) { | 318 ProfileMetrics::ProfileAdd metric) { |
| 319 ProfileInfoCache& cache = | 319 ProfileInfoCache& cache = |
| 320 g_browser_process->profile_manager()->GetProfileInfoCache(); | 320 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 321 | 321 |
| 322 int placeholder_avatar_index = profiles::GetPlaceholderAvatarIndex(); | 322 int placeholder_avatar_index = profiles::GetPlaceholderAvatarIndex(); |
| 323 ProfileManager::CreateMultiProfileAsync( | 323 ProfileManager::CreateMultiProfileAsync( |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 return; | 517 return; |
| 518 case BrowserWindow::AVATAR_BUBBLE_MODE_FAST_USER_SWITCH: | 518 case BrowserWindow::AVATAR_BUBBLE_MODE_FAST_USER_SWITCH: |
| 519 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER; | 519 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER; |
| 520 return; | 520 return; |
| 521 default: | 521 default: |
| 522 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 522 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 523 } | 523 } |
| 524 } | 524 } |
| 525 | 525 |
| 526 } // namespace profiles | 526 } // namespace profiles |
| OLD | NEW |