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

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

Issue 2347173002: Extend FaviconService to support fetching favicons from a Google server (Closed)
Patch Set: Requiring minimum_size Created 4 years 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
« no previous file with comments | « no previous file | components/favicon/core/DEPS » ('j') | components/favicon/core/favicon_service.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/favicon/favicon_service_factory.h" 5 #include "chrome/browser/favicon/favicon_service_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "chrome/browser/favicon/chrome_favicon_client.h" 9 #include "chrome/browser/favicon/chrome_favicon_client.h"
10 #include "chrome/browser/history/history_service_factory.h" 10 #include "chrome/browser/history/history_service_factory.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/search/suggestions/image_decoder_impl.h"
12 #include "components/favicon/core/favicon_service.h" 13 #include "components/favicon/core/favicon_service.h"
13 #include "components/history/core/browser/history_service.h" 14 #include "components/history/core/browser/history_service.h"
15 #include "components/image_fetcher/image_decoder.h"
16 #include "components/image_fetcher/image_fetcher_impl.h"
14 #include "components/keyed_service/content/browser_context_dependency_manager.h" 17 #include "components/keyed_service/content/browser_context_dependency_manager.h"
15 #include "components/prefs/pref_service.h" 18 #include "components/prefs/pref_service.h"
16 19
17 namespace { 20 namespace {
18 21
19 std::unique_ptr<KeyedService> BuildFaviconService( 22 std::unique_ptr<KeyedService> BuildFaviconService(
20 content::BrowserContext* context) { 23 content::BrowserContext* context) {
21 Profile* profile = Profile::FromBrowserContext(context); 24 Profile* profile = Profile::FromBrowserContext(context);
25
22 return base::MakeUnique<favicon::FaviconService>( 26 return base::MakeUnique<favicon::FaviconService>(
23 base::WrapUnique(new ChromeFaviconClient(profile)), 27 base::WrapUnique(new ChromeFaviconClient(profile)),
24 HistoryServiceFactory::GetForProfile(profile, 28 HistoryServiceFactory::GetForProfile(profile,
25 ServiceAccessType::EXPLICIT_ACCESS)); 29 ServiceAccessType::EXPLICIT_ACCESS),
30 base::MakeUnique<image_fetcher::ImageFetcherImpl>(
31 base::MakeUnique<suggestions::ImageDecoderImpl>(),
32 profile->GetRequestContext()));
pkotwicz 2016/12/19 00:03:28 Is ImageFetcherImpl the new hot thing? ContentFavi
jkrcal 2016/12/19 17:07:19 I need to ask colleagues whether image fetcher has
pkotwicz 2016/12/20 02:33:01 If I were you I would wait to get feedback from yo
jkrcal 2017/02/06 19:01:22 Indeed, the ImageFetcherImpl is not ready to decod
pkotwicz 2017/02/07 04:55:54 I am ok with the ImageFetcherImpl
26 } 33 }
27 34
28 } // namespace 35 } // namespace
29 36
30 // static 37 // static
31 favicon::FaviconService* FaviconServiceFactory::GetForProfile( 38 favicon::FaviconService* FaviconServiceFactory::GetForProfile(
32 Profile* profile, 39 Profile* profile,
33 ServiceAccessType sat) { 40 ServiceAccessType sat) {
34 if (!profile->IsOffTheRecord()) { 41 if (!profile->IsOffTheRecord()) {
35 return static_cast<favicon::FaviconService*>( 42 return static_cast<favicon::FaviconService*>(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 75 }
69 76
70 KeyedService* FaviconServiceFactory::BuildServiceInstanceFor( 77 KeyedService* FaviconServiceFactory::BuildServiceInstanceFor(
71 content::BrowserContext* context) const { 78 content::BrowserContext* context) const {
72 return BuildFaviconService(context).release(); 79 return BuildFaviconService(context).release();
73 } 80 }
74 81
75 bool FaviconServiceFactory::ServiceIsNULLWhileTesting() const { 82 bool FaviconServiceFactory::ServiceIsNULLWhileTesting() const {
76 return true; 83 return true;
77 } 84 }
OLDNEW
« no previous file with comments | « no previous file | components/favicon/core/DEPS » ('j') | components/favicon/core/favicon_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698