OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 // Author: khorimoto@google.com (Kyle Horimoto) |
| 3 |
| 4 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h" |
| 5 |
| 6 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 8 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 9 |
| 10 // static |
| 11 ChromeURLDataManager* ChromeURLDataManagerFactory::GetForProfile( |
| 12 Profile* profile) { |
| 13 return static_cast<ChromeURLDataManager*>( |
| 14 GetInstance()->GetServiceForProfile(profile, true)); |
| 15 } |
| 16 |
| 17 // static |
| 18 ChromeURLDataManagerFactory* ChromeURLDataManagerFactory::GetInstance() { |
| 19 return Singleton<ChromeURLDataManagerFactory>::get(); |
| 20 } |
| 21 |
| 22 ChromeURLDataManagerFactory::ChromeURLDataManagerFactory() |
| 23 : ProfileKeyedServiceFactory("ChromeURLDataManager", |
| 24 ProfileDependencyManager::GetInstance()){ |
| 25 } |
| 26 |
| 27 ChromeURLDataManagerFactory::~ChromeURLDataManagerFactory() { |
| 28 } |
| 29 |
| 30 ProfileKeyedService* ChromeURLDataManagerFactory::BuildServiceInstanceFor( |
| 31 Profile* profile) const { |
| 32 return new ChromeURLDataManager( |
| 33 profile->GetChromeURLDataManagerBackendGetter()); |
| 34 } |
| 35 |
| 36 bool ChromeURLDataManagerFactory::ServiceHasOwnInstanceInIncognito() { |
| 37 return true; |
| 38 } |
OLD | NEW |