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); |
} |