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

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: Created 6 years, 7 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 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 }
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