Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/favicon/favicon_service_factory.h" | |
| 6 | |
| 7 #include "chrome/browser/favicon/favicon_service.h" | |
| 8 #include "chrome/browser/history/history.h" | |
| 9 #include "chrome/browser/history/history_service_factory.h" | |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" | |
| 11 | |
| 12 // static | |
| 13 FaviconService* FaviconServiceFactory::GetForProfile(Profile* profile) { | |
| 14 return static_cast<FaviconService*>( | |
| 15 GetInstance()->GetServiceForProfile(profile, true)); | |
| 16 } | |
| 17 | |
| 18 // static | |
| 19 FaviconServiceFactory* FaviconServiceFactory::GetInstance() { | |
| 20 return Singleton<FaviconServiceFactory>::get(); | |
| 21 } | |
| 22 | |
| 23 | |
| 24 FaviconServiceFactory::FaviconServiceFactory() | |
| 25 : ProfileKeyedServiceFactory("FaviconService", | |
| 26 ProfileDependencyManager::GetInstance()) { | |
| 27 DependsOn(HistoryServiceFactory::GetInstance()); | |
| 28 } | |
| 29 | |
| 30 FaviconServiceFactory::~FaviconServiceFactory() { | |
| 31 } | |
| 32 | |
| 33 ProfileKeyedService* FaviconServiceFactory::BuildServiceInstanceFor( | |
| 34 Profile* profile) const { | |
| 35 // FIXME: do not pass the Profile pointer to the FaviconService | |
| 36 // constructor. See comment in FaviconService.h. | |
|
Elliot Glaysher
2012/08/16 19:37:49
While I agree this is suboptimal, this is more of
joth
2012/08/16 21:57:52
AIUI it's a nice-to-have for this patch, but nece
andreip3000
2012/08/17 09:34:57
Yep, I'll look into it after finishing this patch
| |
| 37 return new FaviconService( | |
| 38 HistoryServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS), | |
| 39 profile); | |
| 40 } | |
| 41 | |
| 42 bool FaviconServiceFactory::ServiceRedirectedInIncognito() { | |
| 43 return true; | |
| 44 } | |
| OLD | NEW |