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

Unified Diff: chrome/browser/ui/app_list/app_list_syncable_service_factory.cc

Issue 115733007: Fix non-otr profile's file manager being launched in guest mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: profile->IsGuestSession instead of checking cmd line Created 6 years, 11 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/ui/app_list/app_list_syncable_service_factory.cc
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc b/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
index 616bd0cfc1801f3bd045b675e4b7ab70c68840ad..b0c89ad709a28020fe2446716f3b5da7ba80857b 100644
--- a/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
+++ b/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
@@ -51,6 +51,13 @@ void AppListSyncableServiceFactory::RegisterProfilePrefs(
content::BrowserContext* AppListSyncableServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
+ // In guest session, off the record profile should be used instead of the
+ // original one, as the off the record profile is the active profile.
+ // TODO(tbarzic): Add a helper function to incognito_helpers.h that properly
+ // handles the guest mode.
+ Profile* profile = static_cast<Profile*>(context);
+ if (profile->IsGuestSession())
+ return profile->GetOffTheRecordProfile();
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698