Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(918)

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 127963004: Removal of GetDefaultProfile from UserManagerImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: The replacement was causing a recursion in some cases Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // Note: The user manager will take care of guest profiles. 411 // Note: The user manager will take care of guest profiles.
412 return manager->GetProfileByUser(manager->GetPrimaryUser()); 412 return manager->GetProfileByUser(manager->GetPrimaryUser());
413 #else 413 #else
414 return GetDefaultProfile(); 414 return GetDefaultProfile();
415 #endif 415 #endif
416 } 416 }
417 417
418 Profile* ProfileManager::GetActiveUserProfile() { 418 Profile* ProfileManager::GetActiveUserProfile() {
419 #if defined(OS_CHROMEOS) 419 #if defined(OS_CHROMEOS)
420 ProfileManager* profile_manager = g_browser_process->profile_manager(); 420 ProfileManager* profile_manager = g_browser_process->profile_manager();
421 if (!profile_manager->IsLoggedIn() || !chromeos::UserManager::IsInitialized()) 421 if (!chromeos::UserManager::IsMultipleProfilesAllowed() ||
422 !profile_manager->IsLoggedIn() ||
423 !chromeos::UserManager::IsInitialized())
422 return GetDefaultProfile(); 424 return GetDefaultProfile();
423 chromeos::UserManager* manager = chromeos::UserManager::Get(); 425 chromeos::UserManager* manager = chromeos::UserManager::Get();
424 // Note: The user manager will take care of guest profiles. 426 // Note: The user manager will take care of guest profiles.
425 return manager->GetProfileByUser(manager->GetActiveUser()); 427 return manager->GetProfileByUser(manager->GetActiveUser());
426 #else 428 #else
427 return GetDefaultProfile(); 429 return GetDefaultProfile();
428 #endif 430 #endif
429 } 431 }
430 432
431 Profile* ProfileManager::GetDefaultProfile( 433 Profile* ProfileManager::GetDefaultProfile(
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 ProfileManager::ProfileInfo::ProfileInfo( 1249 ProfileManager::ProfileInfo::ProfileInfo(
1248 Profile* profile, 1250 Profile* profile,
1249 bool created) 1251 bool created)
1250 : profile(profile), 1252 : profile(profile),
1251 created(created) { 1253 created(created) {
1252 } 1254 }
1253 1255
1254 ProfileManager::ProfileInfo::~ProfileInfo() { 1256 ProfileManager::ProfileInfo::~ProfileInfo() {
1255 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); 1257 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release());
1256 } 1258 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698