Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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_fallback_icon_client_factory.h" | |
| 6 | |
| 7 #include "base/memory/singleton.h" | |
| 8 #include "chrome/browser/favicon/chrome_fallback_icon_client.h" | |
| 9 #include "chrome/browser/profiles/incognito_helpers.h" | |
| 10 #include "chrome/browser/profiles/profile.h" | |
|
pkotwicz
2015/03/27 03:52:09
Nit: Including profile.h is unnecessary because yo
huangs
2015/03/27 17:33:07
GetServiceForBrowserContext() call has an implicit
| |
| 11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
| 12 | |
| 13 ChromeFallbackIconClientFactory::ChromeFallbackIconClientFactory() | |
| 14 : BrowserContextKeyedServiceFactory( | |
| 15 "ChromeFallbackIconClient", | |
| 16 BrowserContextDependencyManager::GetInstance()) { | |
| 17 } | |
| 18 | |
| 19 ChromeFallbackIconClientFactory::~ChromeFallbackIconClientFactory() { | |
| 20 } | |
| 21 | |
| 22 // static | |
| 23 FallbackIconClient* ChromeFallbackIconClientFactory::GetForProfile( | |
| 24 Profile* profile) { | |
| 25 return static_cast<FallbackIconClient*>( | |
| 26 GetInstance()->GetServiceForBrowserContext(profile, true)); | |
| 27 } | |
| 28 | |
| 29 // static | |
| 30 ChromeFallbackIconClientFactory* | |
| 31 ChromeFallbackIconClientFactory::GetInstance() { | |
| 32 return Singleton<ChromeFallbackIconClientFactory>::get(); | |
| 33 } | |
| 34 | |
| 35 KeyedService* ChromeFallbackIconClientFactory::BuildServiceInstanceFor( | |
| 36 content::BrowserContext* context) const { | |
| 37 ChromeFallbackIconClient* client = new ChromeFallbackIconClient(); | |
| 38 return client; | |
|
pkotwicz
2015/03/27 03:52:09
Nit: "return new ChromeFallbackIconClient();"
huangs
2015/03/27 17:33:07
Done.
| |
| 39 } | |
| 40 | |
| 41 content::BrowserContext* | |
| 42 ChromeFallbackIconClientFactory::GetBrowserContextToUse( | |
| 43 content::BrowserContext* context) const { | |
| 44 return chrome::GetBrowserContextRedirectedInIncognito(context); | |
| 45 } | |
| OLD | NEW |