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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 // On ChromeOS and Android the ProfileManager will use the same path as the | 371 // On ChromeOS and Android the ProfileManager will use the same path as the |
372 // one we got passed. GetActiveUserProfile will therefore use the correct path | 372 // one we got passed. GetActiveUserProfile will therefore use the correct path |
373 // automatically. | 373 // automatically. |
374 DCHECK_EQ(user_data_dir.value(), | 374 DCHECK_EQ(user_data_dir.value(), |
375 g_browser_process->profile_manager()->user_data_dir().value()); | 375 g_browser_process->profile_manager()->user_data_dir().value()); |
376 profile = ProfileManager::GetActiveUserProfile(); | 376 profile = ProfileManager::GetActiveUserProfile(); |
377 #else | 377 #else |
378 base::FilePath profile_path = | 378 base::FilePath profile_path = |
379 GetStartupProfilePath(user_data_dir, parsed_command_line); | 379 GetStartupProfilePath(user_data_dir, parsed_command_line); |
380 | 380 |
381 // Without NewAvatarMenu, replace guest with any existing profile. | |
382 if (!switches::IsNewAvatarMenu() && | |
383 profile_path == ProfileManager::GetGuestProfilePath()) { | |
384 profile_path = g_browser_process->profile_manager()->GetProfileInfoCache(). | |
385 GetPathOfProfileAtIndex(0); | |
386 } | |
387 profile = g_browser_process->profile_manager()->GetProfile( | 381 profile = g_browser_process->profile_manager()->GetProfile( |
388 profile_path); | 382 profile_path); |
389 | 383 |
390 // If we're using the --new-profile-management flag and this profile is | 384 // If we're using the --new-profile-management flag and this profile is |
391 // signed out, then we should show the user manager instead. By switching | 385 // signed out, then we should show the user manager instead. By switching |
392 // the active profile to the guest profile we ensure that no | 386 // the active profile to the guest profile we ensure that no |
393 // browser windows will be opened for the guest profile. | 387 // browser windows will be opened for the guest profile. |
394 if (switches::IsNewProfileManagement() && | 388 if (switches::IsNewProfileManagement() && |
395 profile && | 389 profile && |
396 !profile->IsGuestSession()) { | 390 !profile->IsGuestSession()) { |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 chromeos::CrosSettings::Shutdown(); | 1830 chromeos::CrosSettings::Shutdown(); |
1837 #endif // defined(OS_CHROMEOS) | 1831 #endif // defined(OS_CHROMEOS) |
1838 #endif // defined(OS_ANDROID) | 1832 #endif // defined(OS_ANDROID) |
1839 } | 1833 } |
1840 | 1834 |
1841 // Public members: | 1835 // Public members: |
1842 | 1836 |
1843 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1837 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1844 chrome_extra_parts_.push_back(parts); | 1838 chrome_extra_parts_.push_back(parts); |
1845 } | 1839 } |
OLD | NEW |