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

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

Issue 13633003: Part of multiprofile implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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
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 <set> 5 #include <set>
6 6
7 #include "chrome/browser/profiles/profile_manager.h" 7 #include "chrome/browser/profiles/profile_manager.h"
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // TODO (mukai,nkostylev): In the long term we should fix those cases that 217 // TODO (mukai,nkostylev): In the long term we should fix those cases that
218 // crash on Guest mode and have only one GetDefaultProfile() method. 218 // crash on Guest mode and have only one GetDefaultProfile() method.
219 Profile* profile = GetDefaultProfile(); 219 Profile* profile = GetDefaultProfile();
220 #if defined(OS_CHROMEOS) 220 #if defined(OS_CHROMEOS)
221 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) 221 if (chromeos::UserManager::Get()->IsLoggedInAsGuest())
222 profile = profile->GetOffTheRecordProfile(); 222 profile = profile->GetOffTheRecordProfile();
223 #endif 223 #endif
224 return profile; 224 return profile;
225 } 225 }
226 226
227 #if defined(OS_CHROMEOS)
228 Profile* ProfileManager::GetSigninProfile(
229 const base::FilePath& user_data_dir) {
230 base::FilePath signin_profile_dir =
231 user_data_dir.AppendASCII(chrome::kInitialProfile);
232 return GetProfile(signin_profile_dir)->GetOffTheRecordProfile();
233 }
234
235 // static
236 Profile* ProfileManager::GetSigninProfile() {
237 ProfileManager* profile_manager = g_browser_process->profile_manager();
238 return profile_manager->GetSigninProfile(profile_manager->user_data_dir_);
239 }
240 #endif
241
227 // static 242 // static
228 Profile* ProfileManager::GetLastUsedProfile() { 243 Profile* ProfileManager::GetLastUsedProfile() {
229 ProfileManager* profile_manager = g_browser_process->profile_manager(); 244 ProfileManager* profile_manager = g_browser_process->profile_manager();
230 return profile_manager->GetLastUsedProfile(profile_manager->user_data_dir_); 245 return profile_manager->GetLastUsedProfile(profile_manager->user_data_dir_);
231 } 246 }
232 247
233 // static 248 // static
234 std::vector<Profile*> ProfileManager::GetLastOpenedProfiles() { 249 std::vector<Profile*> ProfileManager::GetLastOpenedProfiles() {
235 ProfileManager* profile_manager = g_browser_process->profile_manager(); 250 ProfileManager* profile_manager = g_browser_process->profile_manager();
236 return profile_manager->GetLastOpenedProfiles( 251 return profile_manager->GetLastOpenedProfiles(
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 ProfileManager::ProfileInfo::ProfileInfo( 1125 ProfileManager::ProfileInfo::ProfileInfo(
1111 Profile* profile, 1126 Profile* profile,
1112 bool created) 1127 bool created)
1113 : profile(profile), 1128 : profile(profile),
1114 created(created) { 1129 created(created) {
1115 } 1130 }
1116 1131
1117 ProfileManager::ProfileInfo::~ProfileInfo() { 1132 ProfileManager::ProfileInfo::~ProfileInfo() {
1118 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); 1133 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release());
1119 } 1134 }
OLDNEW
« chrome/browser/profiles/profile_manager.h ('K') | « chrome/browser/profiles/profile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698