Chromium Code Reviews| Index: chrome/browser/favicon/chrome_favicon_client_factory.cc |
| diff --git a/chrome/browser/favicon/chrome_favicon_client_factory.cc b/chrome/browser/favicon/chrome_favicon_client_factory.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8c3cb2a0ddd51aaa4c262649806925a430ce751c |
| --- /dev/null |
| +++ b/chrome/browser/favicon/chrome_favicon_client_factory.cc |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2014 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/chrome_favicon_client_factory.h" |
| + |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "components/keyed_service/content/browser_context_dependency_manager.h" |
| + |
| +ChromeFaviconClientFactory::ChromeFaviconClientFactory() |
| + : BrowserContextKeyedServiceFactory( |
| + "ChromeFaviconClient", |
| + BrowserContextDependencyManager::GetInstance()) { |
| +} |
| + |
| +ChromeFaviconClientFactory::~ChromeFaviconClientFactory() { |
| +} |
| + |
| +// static |
| +FaviconClient* ChromeFaviconClientFactory::GetForProfile(Profile* profile) { |
| + return static_cast<FaviconClient*>( |
| + GetInstance()->GetServiceForBrowserContext(profile, true)); |
| +} |
| + |
| +// static |
| +ChromeFaviconClientFactory* ChromeFaviconClientFactory::GetInstance() { |
| + return Singleton<ChromeFaviconClientFactory>::get(); |
| +} |
| + |
| +KeyedService* ChromeFaviconClientFactory::BuildServiceInstanceFor( |
| + content::BrowserContext* context) const { |
| + ChromeFaviconClient* client = |
| + new ChromeFaviconClient(static_cast<Profile*>(context)); |
|
blundell
2014/05/27 09:35:08
nit: use Profile::FromBrowserContext(context).
jif-google
2014/05/27 15:02:07
Done.
|
| + return client; |
| +} |