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

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

Issue 10857037: Make FaviconService a ProfileKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the tests Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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/favicon_service_factory.h"
6
7 #include "chrome/browser/favicon/favicon_service.h"
8 #include "chrome/browser/history/history.h"
9 #include "chrome/browser/history/history_service_factory.h"
10 #include "chrome/browser/profiles/profile_dependency_manager.h"
11
12 // static
13 FaviconService* FaviconServiceFactory::GetForProfile(Profile* profile) {
14 return static_cast<FaviconService*>(
15 GetInstance()->GetServiceForProfile(profile, true));
16 }
17
18 // static
19 FaviconServiceFactory* FaviconServiceFactory::GetInstance() {
20 return Singleton<FaviconServiceFactory>::get();
21 }
22
23
24 FaviconServiceFactory::FaviconServiceFactory()
25 : ProfileKeyedServiceFactory("FaviconService",
26 ProfileDependencyManager::GetInstance()) {
27 DependsOn(HistoryServiceFactory::GetInstance());
28 }
29
30 FaviconServiceFactory::~FaviconServiceFactory() {
31 }
32
33 ProfileKeyedService* FaviconServiceFactory::BuildServiceInstanceFor(
34 Profile* profile) const {
35 // FIXME: do not pass the Profile pointer to the FaviconService
36 // constructor. See comment in FaviconService.h.
Elliot Glaysher 2012/08/16 19:37:49 While I agree this is suboptimal, this is more of
joth 2012/08/16 21:57:52 AIUI it's a nice-to-have for this patch, but nece
andreip3000 2012/08/17 09:34:57 Yep, I'll look into it after finishing this patch
37 return new FaviconService(
38 HistoryServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS),
39 profile);
40 }
41
42 bool FaviconServiceFactory::ServiceRedirectedInIncognito() {
43 return true;
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698