summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/profiles/profile_manager.cc8
-rw-r--r--chrome/browser/profiles/profile_manager.h3
-rw-r--r--chrome/browser/task_manager/task_manager.cc2
3 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 7a66ef3..8b20ab3 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -78,6 +78,14 @@ Profile* ProfileManager::GetDefaultProfile() {
return profile_manager->GetDefaultProfile(user_data_dir);
}
+// static
+Profile* ProfileManager::GetLastUsedProfile() {
+ FilePath user_data_dir;
+ PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ return profile_manager->GetLastUsedProfile(user_data_dir);
+}
+
ProfileManager::ProfileManager() : logged_in_(false) {
BrowserList::AddObserver(this);
#if defined(OS_CHROMEOS)
diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h
index e16aeb6..c532a77 100644
--- a/chrome/browser/profiles/profile_manager.h
+++ b/chrome/browser/profiles/profile_manager.h
@@ -96,6 +96,9 @@ class ProfileManager : public base::NonThreadSafe,
// been stored in Local State, hand back the Default profile.
Profile* GetLastUsedProfile(const FilePath& user_data_dir);
+ // Same as instance method but provides the default user_data_dir as well.
+ static Profile* GetLastUsedProfile();
+
// Register the mapping of a directory to a profile name in Local State.
void RegisterProfileName(Profile* profile);
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index 4fe6403..a8709b9 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -954,7 +954,7 @@ void TaskManager::OpenAboutMemory() {
if (!g_browser_process || !g_browser_process->profile_manager())
return;
Profile* profile =
- g_browser_process->profile_manager()->GetDefaultProfile();
+ g_browser_process->profile_manager()->GetLastUsedProfile();
if (!profile)
return;
browser = Browser::Create(profile);