Commit d06e0a36 authored by stevenjb@chromium.org's avatar stevenjb@chromium.org

Use original context for AppListSyncableServiceFactory

BUG=361508

Review URL: https://codereview.chromium.org/231793005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263067 0039d316-1c4b-4281-b951-d872f2087c98
parent 0bceb303
......@@ -13,6 +13,10 @@
#include "extensions/browser/extension_system_provider.h"
#include "extensions/browser/extensions_browser_client.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#endif
namespace app_list {
// static
......@@ -31,7 +35,12 @@ AppListSyncableServiceFactory* AppListSyncableServiceFactory::GetInstance() {
KeyedService* AppListSyncableServiceFactory::BuildInstanceFor(
content::BrowserContext* browser_context) {
Profile* profile = static_cast<Profile*>(browser_context);
VLOG(1) << "BuildServiceInstanceFor: " << profile->GetDebugName();
#if defined(OS_CHROMEOS)
if (chromeos::ProfileHelper::IsSigninProfile(profile))
return NULL;
#endif
VLOG(1) << "BuildInstanceFor: " << profile->GetDebugName()
<< " (" << profile << ")";
return new AppListSyncableService(profile,
extensions::ExtensionSystem::Get(profile));
}
......@@ -59,11 +68,8 @@ void AppListSyncableServiceFactory::RegisterProfilePrefs(
content::BrowserContext* AppListSyncableServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
// In Guest session, off the record profile should not be redirected to the
// original one.
Profile* profile = static_cast<Profile*>(context);
if (profile->IsGuestSession())
return chrome::GetBrowserContextOwnInstanceInIncognito(context);
// This matches the logic in ExtensionSyncServiceFactory, which uses the
// orginal browser context.
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment