| Index: chrome/browser/profiles/profile_keyed_service_factory.cc
|
| diff --git a/chrome/browser/profiles/profile_keyed_service_factory.cc b/chrome/browser/profiles/profile_keyed_service_factory.cc
|
| index cea66c933c15bcf94451f9538da6907f1cc9ffa6..887c9759da463e6fd32416860c7f03ffeda6466d 100644
|
| --- a/chrome/browser/profiles/profile_keyed_service_factory.cc
|
| +++ b/chrome/browser/profiles/profile_keyed_service_factory.cc
|
| @@ -13,7 +13,7 @@
|
|
|
| ProfileKeyedServiceFactory::ProfileKeyedServiceFactory(
|
| ProfileDependencyManager* manager)
|
| - : dependency_manager_(manager) {
|
| + : dependency_manager_(manager), factory_(NULL) {
|
| dependency_manager_->AddComponent(this);
|
| }
|
|
|
| @@ -40,7 +40,11 @@ ProfileKeyedService* ProfileKeyedServiceFactory::GetServiceForProfile(
|
| if (it != mapping_.end())
|
| return it->second;
|
|
|
| - ProfileKeyedService* service = BuildServiceInstanceFor(profile);
|
| + ProfileKeyedService* service;
|
| + if (factory_)
|
| + service = factory_(profile);
|
| + else
|
| + service = BuildServiceInstanceFor(profile);
|
| Associate(profile, service);
|
| return service;
|
| }
|
|
|