Chromium Code Reviews| Index: chrome/browser/favicon/favicon_service_factory.cc |
| diff --git a/chrome/browser/favicon/favicon_service_factory.cc b/chrome/browser/favicon/favicon_service_factory.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0d2c6ccb0071af721cc99697d4ce919327b846fc |
| --- /dev/null |
| +++ b/chrome/browser/favicon/favicon_service_factory.cc |
| @@ -0,0 +1,44 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/favicon/favicon_service_factory.h" |
| + |
| +#include "chrome/browser/favicon/favicon_service.h" |
| +#include "chrome/browser/history/history.h" |
| +#include "chrome/browser/history/history_service_factory.h" |
| +#include "chrome/browser/profiles/profile_dependency_manager.h" |
| + |
| +// static |
| +FaviconService* FaviconServiceFactory::GetForProfile(Profile* profile) { |
| + return static_cast<FaviconService*>( |
| + GetInstance()->GetServiceForProfile(profile, true)); |
| +} |
| + |
| +// static |
| +FaviconServiceFactory* FaviconServiceFactory::GetInstance() { |
| + return Singleton<FaviconServiceFactory>::get(); |
| +} |
| + |
| + |
| +FaviconServiceFactory::FaviconServiceFactory() |
| + : ProfileKeyedServiceFactory("FaviconService", |
| + ProfileDependencyManager::GetInstance()) { |
| + DependsOn(HistoryServiceFactory::GetInstance()); |
| +} |
| + |
| +FaviconServiceFactory::~FaviconServiceFactory() { |
| +} |
| + |
| +ProfileKeyedService* FaviconServiceFactory::BuildServiceInstanceFor( |
| + Profile* profile) const { |
| + // FIXME: do not pass the Profile pointer to the FaviconService |
| + // 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
|
| + return new FaviconService( |
| + HistoryServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS), |
| + profile); |
| +} |
| + |
| +bool FaviconServiceFactory::ServiceRedirectedInIncognito() { |
| + return true; |
| +} |