Chromium Code Reviews| 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 335 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
| 336 // On ChromeOS and Android the ProfileManager will use the same path as the | 336 // On ChromeOS and Android the ProfileManager will use the same path as the |
| 337 // one we got passed. GetActiveUserProfile will therefore use the correct path | 337 // one we got passed. GetActiveUserProfile will therefore use the correct path |
| 338 // automatically. | 338 // automatically. |
| 339 DCHECK_EQ(user_data_dir.value(), | 339 DCHECK_EQ(user_data_dir.value(), |
| 340 g_browser_process->profile_manager()->user_data_dir().value()); | 340 g_browser_process->profile_manager()->user_data_dir().value()); |
| 341 profile = ProfileManager::GetActiveUserProfile(); | 341 profile = ProfileManager::GetActiveUserProfile(); |
| 342 #else | 342 #else |
| 343 base::FilePath profile_path = | 343 base::FilePath profile_path = |
| 344 GetStartupProfilePath(user_data_dir, parsed_command_line); | 344 GetStartupProfilePath(user_data_dir, parsed_command_line); |
| 345 | |
| 346 // Without NewAvatarMenu, replace guest with the default profile. | |
| 347 if (!switches::IsNewAvatarMenu() && | |
| 348 profile_path == ProfileManager::GetGuestProfilePath()) { | |
| 349 profile_path = g_browser_process->profile_manager()->GetProfileInfoCache(). | |
| 350 GetPathOfProfileAtIndex(0); | |
|
jochen (gone - plz use gerrit)
2014/09/08 12:14:21
is zero the default profile? Should maybe be a con
Mike Lerman
2014/09/08 14:02:33
The problem with the last used profile is the last
| |
| 351 } | |
| 345 profile = g_browser_process->profile_manager()->GetProfile( | 352 profile = g_browser_process->profile_manager()->GetProfile( |
| 346 profile_path); | 353 profile_path); |
| 347 | 354 |
| 348 // If we're using the --new-profile-management flag and this profile is | 355 // If we're using the --new-profile-management flag and this profile is |
| 349 // signed out, then we should show the user manager instead. By switching | 356 // signed out, then we should show the user manager instead. By switching |
| 350 // the active profile to the guest profile we ensure that no | 357 // the active profile to the guest profile we ensure that no |
| 351 // browser windows will be opened for the guest profile. | 358 // browser windows will be opened for the guest profile. |
| 352 if (switches::IsNewProfileManagement() && !profile->IsGuestSession()) { | 359 if (switches::IsNewProfileManagement() && !profile->IsGuestSession()) { |
| 353 ProfileInfoCache& cache = | 360 ProfileInfoCache& cache = |
| 354 g_browser_process->profile_manager()->GetProfileInfoCache(); | 361 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| (...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1680 chromeos::CrosSettings::Shutdown(); | 1687 chromeos::CrosSettings::Shutdown(); |
| 1681 #endif | 1688 #endif |
| 1682 #endif | 1689 #endif |
| 1683 } | 1690 } |
| 1684 | 1691 |
| 1685 // Public members: | 1692 // Public members: |
| 1686 | 1693 |
| 1687 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1694 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1688 chrome_extra_parts_.push_back(parts); | 1695 chrome_extra_parts_.push_back(parts); |
| 1689 } | 1696 } |
| OLD | NEW |