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

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

Issue 2347173002: Extend FaviconService to support fetching favicons from a Google server (Closed)
Patch Set: Peter's comments #2 Created 3 years, 10 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 "ios/chrome/browser/favicon/favicon_service_factory.h" 5 #include "ios/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 "components/favicon/core/favicon_service.h" 9 #include "components/favicon/core/favicon_service.h"
10 #include "components/image_fetcher/image_decoder.h"
pkotwicz 2017/02/07 04:55:55 Nit: I think you don't need this include
11 #include "components/image_fetcher/image_fetcher_impl.h"
10 #include "components/keyed_service/core/service_access_type.h" 12 #include "components/keyed_service/core/service_access_type.h"
11 #include "components/keyed_service/ios/browser_state_dependency_manager.h" 13 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
12 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
13 #include "ios/chrome/browser/favicon/favicon_client_impl.h" 15 #include "ios/chrome/browser/favicon/favicon_client_impl.h"
14 #include "ios/chrome/browser/history/history_service_factory.h" 16 #include "ios/chrome/browser/history/history_service_factory.h"
17 #include "ios/chrome/browser/suggestions/ios_image_decoder_impl.h"
15 18
16 namespace ios { 19 namespace ios {
17 20
18 // static 21 // static
19 favicon::FaviconService* FaviconServiceFactory::GetForBrowserState( 22 favicon::FaviconService* FaviconServiceFactory::GetForBrowserState(
20 ios::ChromeBrowserState* browser_state, 23 ios::ChromeBrowserState* browser_state,
21 ServiceAccessType access_type) { 24 ServiceAccessType access_type) {
22 if (!browser_state->IsOffTheRecord()) { 25 if (!browser_state->IsOffTheRecord()) {
23 return static_cast<favicon::FaviconService*>( 26 return static_cast<favicon::FaviconService*>(
24 GetInstance()->GetServiceForBrowserState(browser_state, true)); 27 GetInstance()->GetServiceForBrowserState(browser_state, true));
(...skipping 21 matching lines...) Expand all
46 } 49 }
47 50
48 FaviconServiceFactory::~FaviconServiceFactory() { 51 FaviconServiceFactory::~FaviconServiceFactory() {
49 } 52 }
50 53
51 std::unique_ptr<KeyedService> FaviconServiceFactory::BuildServiceInstanceFor( 54 std::unique_ptr<KeyedService> FaviconServiceFactory::BuildServiceInstanceFor(
52 web::BrowserState* context) const { 55 web::BrowserState* context) const {
53 ios::ChromeBrowserState* browser_state = 56 ios::ChromeBrowserState* browser_state =
54 ios::ChromeBrowserState::FromBrowserState(context); 57 ios::ChromeBrowserState::FromBrowserState(context);
55 return base::MakeUnique<favicon::FaviconService>( 58 return base::MakeUnique<favicon::FaviconService>(
56 base::MakeUnique<FaviconClientImpl>(), 59 base::MakeUnique<FaviconClientImpl>(),
jkrcal 2017/02/06 19:01:22 I am sorry, I've mixed in one rebase line.
57 ios::HistoryServiceFactory::GetForBrowserState( 60 ios::HistoryServiceFactory::GetForBrowserState(
58 browser_state, ServiceAccessType::EXPLICIT_ACCESS)); 61 browser_state, ServiceAccessType::EXPLICIT_ACCESS),
62 base::MakeUnique<image_fetcher::ImageFetcherImpl>(
63 base::MakeUnique<suggestions::IOSImageDecoderImpl>(),
64 browser_state->GetRequestContext()));
59 } 65 }
60 66
61 } // namespace ios 67 } // namespace ios
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698