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

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

Issue 301613004: Turn FaviconClient into a Keyed service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: touching wood Created 6 years, 6 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 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 if (!profile->IsOffTheRecord()) {
22 return static_cast<FaviconClient*>(
23 GetInstance()->GetServiceForBrowserContext(profile, true));
24 }
25 // Profile must be OffTheRecord in this case.
26 return static_cast<FaviconClient*>(GetInstance()->GetServiceForBrowserContext(
27 profile->GetOriginalProfile(), true));
28 }
29
30 // static
31 ChromeFaviconClientFactory* ChromeFaviconClientFactory::GetInstance() {
32 return Singleton<ChromeFaviconClientFactory>::get();
33 }
34
35 KeyedService* ChromeFaviconClientFactory::BuildServiceInstanceFor(
36 content::BrowserContext* context) const {
37 ChromeFaviconClient* client =
38 new ChromeFaviconClient(Profile::FromBrowserContext(context));
39 return client;
40 }
41
42 bool ChromeFaviconClientFactory::ServiceIsNULLWhileTesting() const {
43 return true;
44 }
OLDNEW
« no previous file with comments | « chrome/browser/favicon/chrome_favicon_client_factory.h ('k') | chrome/browser/favicon/favicon_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698