| 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // signed out, then we should show the user manager instead. By switching | 367 // signed out, then we should show the user manager instead. By switching |
| 368 // the active profile to the guest profile we ensure that no | 368 // the active profile to the guest profile we ensure that no |
| 369 // browser windows will be opened for the guest profile. | 369 // browser windows will be opened for the guest profile. |
| 370 if (switches::IsNewProfileManagement() && | 370 if (switches::IsNewProfileManagement() && |
| 371 profile && | 371 profile && |
| 372 !profile->IsGuestSession()) { | 372 !profile->IsGuestSession()) { |
| 373 ProfileInfoCache& cache = | 373 ProfileInfoCache& cache = |
| 374 g_browser_process->profile_manager()->GetProfileInfoCache(); | 374 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 375 size_t profile_index = cache.GetIndexOfProfileWithPath(profile_path); | 375 size_t profile_index = cache.GetIndexOfProfileWithPath(profile_path); |
| 376 | 376 |
| 377 if (cache.ProfileIsSigninRequiredAtIndex(profile_index)) | 377 if (profile_index != std::string::npos && |
| 378 cache.ProfileIsSigninRequiredAtIndex(profile_index)) { |
| 378 profile = g_browser_process->profile_manager()->GetProfile( | 379 profile = g_browser_process->profile_manager()->GetProfile( |
| 379 ProfileManager::GetGuestProfilePath()); | 380 ProfileManager::GetGuestProfilePath()); |
| 381 } |
| 380 } | 382 } |
| 381 #endif // defined(OS_CHROMEOS) || defined(OS_ANDROID) | 383 #endif // defined(OS_CHROMEOS) || defined(OS_ANDROID) |
| 382 if (profile) { | 384 if (profile) { |
| 383 UMA_HISTOGRAM_LONG_TIMES( | 385 UMA_HISTOGRAM_LONG_TIMES( |
| 384 "Startup.CreateFirstProfile", base::Time::Now() - start); | 386 "Startup.CreateFirstProfile", base::Time::Now() - start); |
| 385 return profile; | 387 return profile; |
| 386 } | 388 } |
| 387 | 389 |
| 388 #if !defined(OS_WIN) | 390 #if !defined(OS_WIN) |
| 389 // TODO(port): fix this. See comments near the definition of | 391 // TODO(port): fix this. See comments near the definition of |
| (...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 chromeos::CrosSettings::Shutdown(); | 1730 chromeos::CrosSettings::Shutdown(); |
| 1729 #endif // defined(OS_CHROMEOS) | 1731 #endif // defined(OS_CHROMEOS) |
| 1730 #endif // defined(OS_ANDROID) | 1732 #endif // defined(OS_ANDROID) |
| 1731 } | 1733 } |
| 1732 | 1734 |
| 1733 // Public members: | 1735 // Public members: |
| 1734 | 1736 |
| 1735 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1737 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1736 chrome_extra_parts_.push_back(parts); | 1738 chrome_extra_parts_.push_back(parts); |
| 1737 } | 1739 } |
| OLD | NEW |