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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 9691032: Use OffTheRecord profile in case of GuestLogin for AppList. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
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_);
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/ui/views/ash/app_list/app_list_view_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698