| Index: chrome/browser/extensions/api/profile_keyed_api_factory.h
|
| diff --git a/chrome/browser/extensions/api/profile_keyed_api_factory.h b/chrome/browser/extensions/api/profile_keyed_api_factory.h
|
| index d6267de2a6230550dcedc23ed12962ecfd28e903..384eb3ed2570dff854aa0c61af3cc6d989c723ac 100644
|
| --- a/chrome/browser/extensions/api/profile_keyed_api_factory.h
|
| +++ b/chrome/browser/extensions/api/profile_keyed_api_factory.h
|
| @@ -19,12 +19,12 @@ class ProfileKeyedAPIFactory;
|
|
|
| // Instantiations of ProfileKeyedAPIFactory should use this base class
|
| // and also define a static const char* service_name() function (used in the
|
| -// ProfileKeyedBaseFactory constructor). These fields should be accessible
|
| -// to the ProfileKeyedAPIFactory for the service.
|
| -class ProfileKeyedAPI : public ProfileKeyedService {
|
| +// BrowserContextKeyedBaseFactory constructor). These fields should
|
| +// be accessible to the ProfileKeyedAPIFactory for the service.
|
| +class ProfileKeyedAPI : public BrowserContextKeyedService {
|
| protected:
|
| // Defaults for flags that control ProfileKeyedAPIFactory behavior.
|
| - // See ProfileKeyedBaseFactory for usage.
|
| + // See BrowserContextKeyedBaseFactory for usage.
|
| static const bool kServiceRedirectedInIncognito = false;
|
| static const bool kServiceIsNULLWhileTesting = false;
|
| static const bool kServiceHasOwnInstanceInIncognito = false;
|
| @@ -52,15 +52,16 @@ class ProfileKeyedAPI : public ProfileKeyedService {
|
| // }
|
| };
|
|
|
| -// A template for factories for ProfileKeyedServices that manage extension APIs.
|
| -// T is a ProfileKeyedService that uses this factory template instead of
|
| -// its own separate factory definition to manage its per-profile instances.
|
| +// A template for factories for BrowserContextKeyedServices that manage
|
| +// extension APIs. T is a BrowserContextKeyedService that uses this factory
|
| +// template instead of its own separate factory definition to manage its
|
| +// per-profile instances.
|
| template <typename T>
|
| -class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory {
|
| +class ProfileKeyedAPIFactory : public BrowserContextKeyedServiceFactory {
|
| public:
|
| static T* GetForProfile(Profile* profile) {
|
| return static_cast<T*>(
|
| - T::GetFactoryInstance()->GetServiceForProfile(profile, true));
|
| + T::GetFactoryInstance()->GetServiceForBrowserContext(profile, true));
|
| }
|
|
|
| // Declare dependencies on other factories.
|
| @@ -78,8 +79,9 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory {
|
| }
|
|
|
| ProfileKeyedAPIFactory()
|
| - : ProfileKeyedServiceFactory(T::service_name(),
|
| - ProfileDependencyManager::GetInstance()) {
|
| + : BrowserContextKeyedServiceFactory(
|
| + T::service_name(),
|
| + BrowserContextDependencyManager::GetInstance()) {
|
| DeclareFactoryDependencies();
|
| }
|
|
|
| @@ -87,13 +89,13 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory {
|
| }
|
|
|
| private:
|
| - // ProfileKeyedServiceFactory implementation.
|
| - virtual ProfileKeyedService* BuildServiceInstanceFor(
|
| + // BrowserContextKeyedServiceFactory implementation.
|
| + virtual BrowserContextKeyedService* BuildServiceInstanceFor(
|
| content::BrowserContext* profile) const OVERRIDE {
|
| return new T(static_cast<Profile*>(profile));
|
| }
|
|
|
| - // ProfileKeyedBaseFactory implementation.
|
| + // BrowserContextKeyedBaseFactory implementation.
|
| // These can be effectively overridden with template specializations.
|
| virtual content::BrowserContext* GetBrowserContextToUse(
|
| content::BrowserContext* context) const OVERRIDE {
|
| @@ -103,10 +105,10 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory {
|
| if (T::kServiceHasOwnInstanceInIncognito)
|
| return chrome::GetBrowserContextOwnInstanceInIncognito(context);
|
|
|
| - return ProfileKeyedServiceFactory::GetBrowserContextToUse(context);
|
| + return BrowserContextKeyedServiceFactory::GetBrowserContextToUse(context);
|
| }
|
|
|
| - virtual bool ServiceIsCreatedWithProfile() const OVERRIDE {
|
| + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE {
|
| return true;
|
| }
|
|
|
|
|