Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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/chrome_favicon_client_factory.h" | |
| 6 | |
| 7 #include "chrome/browser/profiles/profile.h" | |
| 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
| 9 | |
| 10 ChromeFaviconClientFactory::ChromeFaviconClientFactory() | |
| 11 : BrowserContextKeyedServiceFactory( | |
| 12 "ChromeFaviconClient", | |
| 13 BrowserContextDependencyManager::GetInstance()) { | |
| 14 } | |
| 15 | |
| 16 ChromeFaviconClientFactory::~ChromeFaviconClientFactory() { | |
| 17 } | |
| 18 | |
| 19 // static | |
| 20 FaviconClient* ChromeFaviconClientFactory::GetForProfile(Profile* profile) { | |
| 21 return static_cast<FaviconClient*>( | |
| 22 GetInstance()->GetServiceForBrowserContext(profile, true)); | |
| 23 } | |
| 24 | |
| 25 // static | |
| 26 ChromeFaviconClientFactory* ChromeFaviconClientFactory::GetInstance() { | |
| 27 return Singleton<ChromeFaviconClientFactory>::get(); | |
| 28 } | |
| 29 | |
| 30 KeyedService* ChromeFaviconClientFactory::BuildServiceInstanceFor( | |
| 31 content::BrowserContext* context) const { | |
| 32 ChromeFaviconClient* client = | |
| 33 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.
| |
| 34 return client; | |
| 35 } | |
| OLD | NEW |