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

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

Issue 23967015: Use multi-profile mount point by default after browser crash and in Guest session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: handle test-user profile as well Created 7 years, 3 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/profiles/profile_helper.cc ('k') | chrome/common/chrome_constants.h » ('j') | 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 } 309 }
310 310
311 base::FilePath ProfileManager::GetInitialProfileDir() { 311 base::FilePath ProfileManager::GetInitialProfileDir() {
312 base::FilePath relative_profile_dir; 312 base::FilePath relative_profile_dir;
313 #if defined(OS_CHROMEOS) 313 #if defined(OS_CHROMEOS)
314 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 314 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
315 if (logged_in_) { 315 if (logged_in_) {
316 base::FilePath profile_dir; 316 base::FilePath profile_dir;
317 // If the user has logged in, pick up the new profile. 317 // If the user has logged in, pick up the new profile.
318 if (command_line.HasSwitch(chromeos::switches::kLoginProfile)) { 318 if (command_line.HasSwitch(chromeos::switches::kLoginProfile)) {
319 profile_dir = command_line.GetSwitchValuePath( 319 // TODO(nkostylev): Remove this code completely once we eliminate
320 chromeos::switches::kLoginProfile); 320 // legacy --login-profile=user switch and enable multi-profiles on CrOS
sail 2013/09/18 18:17:20 Normally we also include a bug number for these ty
Nikita (slow) 2013/09/19 08:17:35 Done.
321 // by default.
322 std::string login_profile_value =
323 command_line.GetSwitchValueASCII(chromeos::switches::kLoginProfile);
324 if (login_profile_value == chrome::kLegacyProfileDir ||
325 login_profile_value == chrome::kTestUserProfileDir) {
326 profile_dir = base::FilePath(login_profile_value);
327 } else {
328 profile_dir = g_browser_process->platform_part()->profile_helper()->
329 GetUserProfileDir(login_profile_value);
330 }
321 } else if (!command_line.HasSwitch(switches::kMultiProfiles)) { 331 } else if (!command_line.HasSwitch(switches::kMultiProfiles)) {
322 // We should never be logged in with no profile dir unless 332 // We should never be logged in with no profile dir unless
323 // multi-profiles are enabled. 333 // multi-profiles are enabled.
324 // In that case profile dir will be defined by user_id hash. 334 // In that case profile dir will be defined by user_id hash.
325 NOTREACHED(); 335 NOTREACHED();
326 return base::FilePath(""); 336 return base::FilePath("");
327 } 337 }
328 // In case of multi-profiles ignore --login-profile switch. 338 // In case of multi-profiles ignore --login-profile switch.
329 // TODO(nkostylev): Some cases like Guest mode will have empty username_hash 339 // TODO(nkostylev): Some cases like Guest mode will have empty username_hash
330 // so default kLoginProfile dir will be used. 340 // so default kLoginProfile dir will be used.
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 ProfileManager::ProfileInfo::ProfileInfo( 1177 ProfileManager::ProfileInfo::ProfileInfo(
1168 Profile* profile, 1178 Profile* profile,
1169 bool created) 1179 bool created)
1170 : profile(profile), 1180 : profile(profile),
1171 created(created) { 1181 created(created) {
1172 } 1182 }
1173 1183
1174 ProfileManager::ProfileInfo::~ProfileInfo() { 1184 ProfileManager::ProfileInfo::~ProfileInfo() {
1175 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); 1185 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release());
1176 } 1186 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/profiles/profile_helper.cc ('k') | chrome/common/chrome_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698