Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Side by Side Diff: chrome/browser/favicon/chrome_fallback_icon_client_factory.cc

Issue 996253002: [Fallback Icons] Refactor FallbackIconService to be a BrowserContext-level singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making FallbackIconSource take FallbackIconService directly. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10
11 ChromeFallbackIconClientFactory::ChromeFallbackIconClientFactory()
12 : BrowserContextKeyedServiceFactory(
13 "ChromeFallbackIconClient",
14 BrowserContextDependencyManager::GetInstance()) {
15 }
16
17 ChromeFallbackIconClientFactory::~ChromeFallbackIconClientFactory() {
18 }
19
20 // static
21 FallbackIconClient* ChromeFallbackIconClientFactory::GetForProfile(
22 Profile* profile) {
23 return static_cast<FallbackIconClient*>(
24 GetInstance()->GetServiceForBrowserContext(profile, true));
25 }
26
27 // static
28 ChromeFallbackIconClientFactory*
29 ChromeFallbackIconClientFactory::GetInstance() {
30 return Singleton<ChromeFallbackIconClientFactory>::get();
31 }
32
33 KeyedService* ChromeFallbackIconClientFactory::BuildServiceInstanceFor(
34 content::BrowserContext* context) const {
35 ChromeFallbackIconClient* client =
36 new ChromeFallbackIconClient(Profile::FromBrowserContext(context));
37 return client;
38 }
39
40 content::BrowserContext*
41 ChromeFallbackIconClientFactory::GetBrowserContextToUse(
42 content::BrowserContext* context) const {
43 return chrome::GetBrowserContextRedirectedInIncognito(context);
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698