| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/app_restore_service_factory.h" | 5 #include "chrome/browser/extensions/image_loader_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/app_restore_service.h" | 7 #include "chrome/browser/extensions/image_loader.h" |
| 8 #include "chrome/browser/profiles/profile_dependency_manager.h" | 8 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 9 | 9 |
| 10 namespace extensions { | 10 namespace extensions { |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 AppRestoreService* AppRestoreServiceFactory::GetForProfile(Profile* profile) { | 13 ImageLoader* ImageLoaderFactory::GetForProfile(Profile* profile) { |
| 14 return static_cast<AppRestoreService*>( | 14 return static_cast<ImageLoader*>( |
| 15 GetInstance()->GetServiceForProfile(profile, true)); | 15 GetInstance()->GetServiceForProfile(profile, true)); |
| 16 } | 16 } |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 void AppRestoreServiceFactory::ResetForProfile(Profile* profile) { | 19 void ImageLoaderFactory::ResetForProfile(Profile* profile) { |
| 20 AppRestoreServiceFactory* factory = GetInstance(); | 20 ImageLoaderFactory* factory = GetInstance(); |
| 21 factory->ProfileShutdown(profile); | 21 factory->ProfileShutdown(profile); |
| 22 factory->ProfileDestroyed(profile); | 22 factory->ProfileDestroyed(profile); |
| 23 } | 23 } |
| 24 | 24 |
| 25 AppRestoreServiceFactory* AppRestoreServiceFactory::GetInstance() { | 25 ImageLoaderFactory* ImageLoaderFactory::GetInstance() { |
| 26 return Singleton<AppRestoreServiceFactory>::get(); | 26 return Singleton<ImageLoaderFactory>::get(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 AppRestoreServiceFactory::AppRestoreServiceFactory() | 29 ImageLoaderFactory::ImageLoaderFactory() |
| 30 : ProfileKeyedServiceFactory("AppRestoreService", | 30 : ProfileKeyedServiceFactory("ImageLoader", |
| 31 ProfileDependencyManager::GetInstance()) { | 31 ProfileDependencyManager::GetInstance()) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 AppRestoreServiceFactory::~AppRestoreServiceFactory() { | 34 ImageLoaderFactory::~ImageLoaderFactory() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 ProfileKeyedService* AppRestoreServiceFactory::BuildServiceInstanceFor( | 37 ProfileKeyedService* ImageLoaderFactory::BuildServiceInstanceFor( |
| 38 Profile* profile) const { | 38 Profile* profile) const { |
| 39 AppRestoreService* service = NULL; | 39 return new ImageLoader; |
| 40 service = new AppRestoreService(profile); | |
| 41 return service; | |
| 42 } | 40 } |
| 43 | 41 |
| 44 bool AppRestoreServiceFactory::ServiceIsCreatedWithProfile() const { | 42 bool ImageLoaderFactory::ServiceIsCreatedWithProfile() const { |
| 43 return false; |
| 44 } |
| 45 |
| 46 bool ImageLoaderFactory::ServiceRedirectedInIncognito() const { |
| 45 return true; | 47 return true; |
| 46 } | 48 } |
| 47 | 49 |
| 48 } // namespace extensions | 50 } // namespace extensions |
| OLD | NEW |