OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/doodle/doodle_service_factory.h" | 5 #include "chrome/browser/doodle/doodle_service_factory.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/metrics/field_trial_params.h" | 11 #include "base/metrics/field_trial_params.h" |
12 #include "base/time/default_clock.h" | 12 #include "base/time/default_clock.h" |
13 #include "base/time/default_tick_clock.h" | 13 #include "base/time/default_tick_clock.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "chrome/browser/google/google_url_tracker_factory.h" | 15 #include "chrome/browser/google/google_url_tracker_factory.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/search/suggestions/image_decoder_impl.h" |
17 #include "components/doodle/doodle_fetcher.h" | 18 #include "components/doodle/doodle_fetcher.h" |
18 #include "components/doodle/doodle_fetcher_impl.h" | 19 #include "components/doodle/doodle_fetcher_impl.h" |
19 #include "components/doodle/doodle_service.h" | 20 #include "components/doodle/doodle_service.h" |
| 21 #include "components/image_fetcher/core/image_fetcher_impl.h" |
20 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 22 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
21 #include "components/prefs/pref_service.h" | 23 #include "components/prefs/pref_service.h" |
22 #include "components/safe_json/safe_json_parser.h" | 24 #include "components/safe_json/safe_json_parser.h" |
23 | 25 |
24 #if defined(OS_ANDROID) | 26 #if defined(OS_ANDROID) |
25 #include "chrome/browser/android/chrome_feature_list.h" | 27 #include "chrome/browser/android/chrome_feature_list.h" |
26 #endif | 28 #endif |
27 | 29 |
28 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
29 namespace { | 31 namespace { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 auto fetcher = base::MakeUnique<doodle::DoodleFetcherImpl>( | 80 auto fetcher = base::MakeUnique<doodle::DoodleFetcherImpl>( |
79 profile->GetRequestContext(), | 81 profile->GetRequestContext(), |
80 GoogleURLTrackerFactory::GetForProfile(profile), | 82 GoogleURLTrackerFactory::GetForProfile(profile), |
81 base::Bind(&safe_json::SafeJsonParser::Parse), use_gray_background, | 83 base::Bind(&safe_json::SafeJsonParser::Parse), use_gray_background, |
82 override_url); | 84 override_url); |
83 return new doodle::DoodleService( | 85 return new doodle::DoodleService( |
84 profile->GetPrefs(), std::move(fetcher), | 86 profile->GetPrefs(), std::move(fetcher), |
85 base::MakeUnique<base::OneShotTimer>(), | 87 base::MakeUnique<base::OneShotTimer>(), |
86 base::MakeUnique<base::DefaultClock>(), | 88 base::MakeUnique<base::DefaultClock>(), |
87 base::MakeUnique<base::DefaultTickClock>(), | 89 base::MakeUnique<base::DefaultTickClock>(), |
88 /*override_min_refresh_interval=*/base::nullopt); | 90 /*override_min_refresh_interval=*/base::nullopt, |
| 91 base::MakeUnique<image_fetcher::ImageFetcherImpl>( |
| 92 base::MakeUnique<suggestions::ImageDecoderImpl>(), |
| 93 profile->GetRequestContext())); |
89 } | 94 } |
OLD | NEW |