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

Side by Side Diff: ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.cc

Issue 2866033002: [NTP Tiles] Fetch missing MostLikely tiles from a Google server (Closed)
Patch Set: Comments #3 Created 3 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ntp_tiles/ios_most_visited_sites_factory.h" 5 #include "ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/threading/sequenced_worker_pool.h" 8 #include "base/threading/sequenced_worker_pool.h"
9 #include "components/history/core/browser/top_sites.h" 9 #include "components/history/core/browser/top_sites.h"
10 #include "components/image_fetcher/core/image_fetcher_impl.h" 10 #include "components/image_fetcher/core/image_fetcher_impl.h"
11 #include "components/image_fetcher/ios/ios_image_decoder_impl.h" 11 #include "components/image_fetcher/ios/ios_image_decoder_impl.h"
12 #include "components/keyed_service/core/service_access_type.h" 12 #include "components/keyed_service/core/service_access_type.h"
13 #include "components/ntp_tiles/icon_cacher_impl.h" 13 #include "components/ntp_tiles/icon_cacher_impl.h"
14 #include "components/ntp_tiles/most_visited_sites.h" 14 #include "components/ntp_tiles/most_visited_sites.h"
15 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 15 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
16 #include "ios/chrome/browser/favicon/favicon_service_factory.h" 16 #include "ios/chrome/browser/favicon/favicon_service_factory.h"
17 #include "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h"
17 #include "ios/chrome/browser/history/top_sites_factory.h" 18 #include "ios/chrome/browser/history/top_sites_factory.h"
18 #include "ios/chrome/browser/ntp_tiles/ios_popular_sites_factory.h" 19 #include "ios/chrome/browser/ntp_tiles/ios_popular_sites_factory.h"
19 #include "ios/chrome/browser/suggestions/suggestions_service_factory.h" 20 #include "ios/chrome/browser/suggestions/suggestions_service_factory.h"
20 #include "ios/web/public/web_thread.h" 21 #include "ios/web/public/web_thread.h"
21 22
22 std::unique_ptr<ntp_tiles::MostVisitedSites> 23 std::unique_ptr<ntp_tiles::MostVisitedSites>
23 IOSMostVisitedSitesFactory::NewForBrowserState( 24 IOSMostVisitedSitesFactory::NewForBrowserState(
24 ios::ChromeBrowserState* browser_state) { 25 ios::ChromeBrowserState* browser_state) {
25 scoped_refptr<base::SequencedTaskRunner> task_runner = 26 scoped_refptr<base::SequencedTaskRunner> task_runner =
26 web::WebThread::GetBlockingPool() 27 web::WebThread::GetBlockingPool()
27 ->GetSequencedTaskRunnerWithShutdownBehavior( 28 ->GetSequencedTaskRunnerWithShutdownBehavior(
28 base::SequencedWorkerPool::GetSequenceToken(), 29 base::SequencedWorkerPool::GetSequenceToken(),
29 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); 30 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
30 return base::MakeUnique<ntp_tiles::MostVisitedSites>( 31 return base::MakeUnique<ntp_tiles::MostVisitedSites>(
31 browser_state->GetPrefs(), 32 browser_state->GetPrefs(),
32 ios::TopSitesFactory::GetForBrowserState(browser_state), 33 ios::TopSitesFactory::GetForBrowserState(browser_state),
33 suggestions::SuggestionsServiceFactory::GetForBrowserState(browser_state), 34 suggestions::SuggestionsServiceFactory::GetForBrowserState(browser_state),
34 IOSPopularSitesFactory::NewForBrowserState(browser_state), 35 IOSPopularSitesFactory::NewForBrowserState(browser_state),
35 base::MakeUnique<ntp_tiles::IconCacherImpl>( 36 base::MakeUnique<ntp_tiles::IconCacherImpl>(
36 ios::FaviconServiceFactory::GetForBrowserState( 37 ios::FaviconServiceFactory::GetForBrowserState(
37 browser_state, ServiceAccessType::IMPLICIT_ACCESS), 38 browser_state, ServiceAccessType::IMPLICIT_ACCESS),
39 IOSChromeLargeIconServiceFactory::GetForBrowserState(browser_state),
38 base::MakeUnique<image_fetcher::ImageFetcherImpl>( 40 base::MakeUnique<image_fetcher::ImageFetcherImpl>(
39 image_fetcher::CreateIOSImageDecoder(task_runner), 41 image_fetcher::CreateIOSImageDecoder(task_runner),
40 browser_state->GetRequestContext())), 42 browser_state->GetRequestContext())),
41 nil); 43 nil);
42 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698