Index: chrome/browser/profiles/profile_manager.cc |
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
index fc9d18615c80cd0e44204a97fd6d80a78d551e16..e8dcab83055ebd981c1e09a0005f4178318da1d9 100644 |
--- a/chrome/browser/profiles/profile_manager.cc |
+++ b/chrome/browser/profiles/profile_manager.cc |
@@ -51,6 +51,7 @@ |
#if defined(OS_CHROMEOS) |
#include "chrome/browser/chromeos/cros/cros_library.h" |
#include "chrome/browser/chromeos/cros/cryptohome_library.h" |
+#include "chrome/browser/chromeos/login/user_manager.h" |
#endif |
using content::BrowserThread; |
@@ -183,6 +184,18 @@ Profile* ProfileManager::GetDefaultProfile() { |
} |
// static |
+Profile* ProfileManager::GetDefaultProfileOrOffTheRecord() { |
+ // TODO (mukai,nkostylev): In the long term we should fix those cases that |
+ // crash on Guest mode and have only one GetDefaultProfile() method. |
+ Profile* profile = GetDefaultProfile(); |
+#if defined(OS_CHROMEOS) |
+ if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) |
+ profile = profile->GetOffTheRecordProfile(); |
+#endif |
+ return profile; |
+} |
+ |
+// static |
Profile* ProfileManager::GetLastUsedProfile() { |
ProfileManager* profile_manager = g_browser_process->profile_manager(); |
return profile_manager->GetLastUsedProfile(profile_manager->user_data_dir_); |