#include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
#include "base/prefs/pref_service.h"
-#include "chrome/browser/extensions/extension_system.h"
-#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/app_list_syncable_service.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
+#include "extensions/browser/extension_system.h"
+#include "extensions/browser/extension_system_provider.h"
+#include "extensions/browser/extensions_browser_client.h"
namespace app_list {
: BrowserContextKeyedServiceFactory(
"AppListSyncableService",
BrowserContextDependencyManager::GetInstance()) {
- DependsOn(extensions::ExtensionSystemFactory::GetInstance());
+ DependsOn(
+ extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
}
AppListSyncableServiceFactory::~AppListSyncableServiceFactory() {
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.
+ // 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 profile->GetOffTheRecordProfile();
+ return chrome::GetBrowserContextOwnInstanceInIncognito(context);
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
-bool AppListSyncableServiceFactory::ServiceIsCreatedWithBrowserContext() const {
- return true;
-}
-
} // namespace app_list