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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 profile_path = g_browser_process->profile_manager()->GetProfileInfoCache(). | 357 profile_path = g_browser_process->profile_manager()->GetProfileInfoCache(). |
358 GetPathOfProfileAtIndex(0); | 358 GetPathOfProfileAtIndex(0); |
359 } | 359 } |
360 profile = g_browser_process->profile_manager()->GetProfile( | 360 profile = g_browser_process->profile_manager()->GetProfile( |
361 profile_path); | 361 profile_path); |
362 | 362 |
363 // If we're using the --new-profile-management flag and this profile is | 363 // If we're using the --new-profile-management flag and this profile is |
364 // signed out, then we should show the user manager instead. By switching | 364 // signed out, then we should show the user manager instead. By switching |
365 // the active profile to the guest profile we ensure that no | 365 // the active profile to the guest profile we ensure that no |
366 // browser windows will be opened for the guest profile. | 366 // browser windows will be opened for the guest profile. |
367 if (switches::IsNewProfileManagement() && !profile->IsGuestSession()) { | 367 if (switches::IsNewProfileManagement() && |
| 368 profile && |
| 369 !profile->IsGuestSession()) { |
368 ProfileInfoCache& cache = | 370 ProfileInfoCache& cache = |
369 g_browser_process->profile_manager()->GetProfileInfoCache(); | 371 g_browser_process->profile_manager()->GetProfileInfoCache(); |
370 size_t profile_index = cache.GetIndexOfProfileWithPath(profile_path); | 372 size_t profile_index = cache.GetIndexOfProfileWithPath(profile_path); |
371 | 373 |
372 if (cache.ProfileIsSigninRequiredAtIndex(profile_index)) | 374 if (cache.ProfileIsSigninRequiredAtIndex(profile_index)) |
373 profile = g_browser_process->profile_manager()->GetProfile( | 375 profile = g_browser_process->profile_manager()->GetProfile( |
374 ProfileManager::GetGuestProfilePath()); | 376 ProfileManager::GetGuestProfilePath()); |
375 } | 377 } |
376 #endif | 378 #endif |
377 if (profile) { | 379 if (profile) { |
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 chromeos::CrosSettings::Shutdown(); | 1712 chromeos::CrosSettings::Shutdown(); |
1711 #endif | 1713 #endif |
1712 #endif | 1714 #endif |
1713 } | 1715 } |
1714 | 1716 |
1715 // Public members: | 1717 // Public members: |
1716 | 1718 |
1717 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1719 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1718 chrome_extra_parts_.push_back(parts); | 1720 chrome_extra_parts_.push_back(parts); |
1719 } | 1721 } |
OLD | NEW |