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

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

Issue 1051843002: Use last active profile instead of default profile in profile manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | 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 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 if (profile_info && !profile_info->created) 1099 if (profile_info && !profile_info->created)
1100 default_profile_dir = profiles::GetDefaultProfileDir(user_data_dir); 1100 default_profile_dir = profiles::GetDefaultProfileDir(user_data_dir);
1101 1101
1102 Profile* profile = GetProfile(default_profile_dir); 1102 Profile* profile = GetProfile(default_profile_dir);
1103 // Some unit tests didn't initialize the UserManager. 1103 // Some unit tests didn't initialize the UserManager.
1104 if (user_manager::UserManager::IsInitialized() && 1104 if (user_manager::UserManager::IsInitialized() &&
1105 user_manager::UserManager::Get()->IsLoggedInAsGuest()) 1105 user_manager::UserManager::Get()->IsLoggedInAsGuest())
1106 return profile->GetOffTheRecordProfile(); 1106 return profile->GetOffTheRecordProfile();
1107 return profile; 1107 return profile;
1108 #else 1108 #else
1109 base::FilePath default_profile_dir(user_data_dir); 1109 return GetProfile(GetLastUsedProfileDir(user_data_dir));
1110 default_profile_dir = default_profile_dir.Append(GetInitialProfileDir());
Mr4D (OOO till 08-26) 2015/04/15 19:26:21 Looking into line 473 above there is a TODO commen
1111 return GetProfile(default_profile_dir);
1112 #endif 1110 #endif
1113 } 1111 }
1114 1112
1115 bool ProfileManager::AddProfile(Profile* profile) { 1113 bool ProfileManager::AddProfile(Profile* profile) {
1116 TRACE_EVENT0("browser", "ProfileManager::AddProfile"); 1114 TRACE_EVENT0("browser", "ProfileManager::AddProfile");
1117 DCHECK(profile); 1115 DCHECK(profile);
1118 1116
1119 // Make sure that we're not loading a profile with the same ID as a profile 1117 // Make sure that we're not loading a profile with the same ID as a profile
1120 // that's already loaded. 1118 // that's already loaded.
1121 if (GetProfileByPathInternal(profile->GetPath())) { 1119 if (GetProfileByPathInternal(profile->GetPath())) {
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 } 1390 }
1393 1391
1394 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); 1392 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path);
1395 if (!original_callback.is_null()) 1393 if (!original_callback.is_null())
1396 original_callback.Run(loaded_profile, status); 1394 original_callback.Run(loaded_profile, status);
1397 } 1395 }
1398 1396
1399 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1397 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1400 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1398 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1401 } 1399 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698