| OLD | NEW |
| 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 "components/ntp_snippets/remote/remote_suggestions_provider_impl.h" | 5 #include "components/ntp_snippets/remote/remote_suggestions_provider_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 : image_fetcher_(std::move(image_fetcher)), | 166 : image_fetcher_(std::move(image_fetcher)), |
| 167 image_decoder_(std::move(image_decoder)), | 167 image_decoder_(std::move(image_decoder)), |
| 168 database_(database), | 168 database_(database), |
| 169 thumbnail_requests_throttler_( | 169 thumbnail_requests_throttler_( |
| 170 pref_service, | 170 pref_service, |
| 171 RequestThrottler::RequestType::CONTENT_SUGGESTION_THUMBNAIL) { | 171 RequestThrottler::RequestType::CONTENT_SUGGESTION_THUMBNAIL) { |
| 172 // |image_fetcher_| can be null in tests. | 172 // |image_fetcher_| can be null in tests. |
| 173 if (image_fetcher_) { | 173 if (image_fetcher_) { |
| 174 image_fetcher_->SetImageFetcherDelegate(this); | 174 image_fetcher_->SetImageFetcherDelegate(this); |
| 175 image_fetcher_->SetDataUseServiceName( | 175 image_fetcher_->SetDataUseServiceName( |
| 176 data_use_measurement::DataUseUserData::NTP_SNIPPETS); | 176 data_use_measurement::DataUseUserData::NTP_SNIPPETS_THUMBNAILS); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 CachedImageFetcher::~CachedImageFetcher() {} | 180 CachedImageFetcher::~CachedImageFetcher() {} |
| 181 | 181 |
| 182 void CachedImageFetcher::FetchSuggestionImage( | 182 void CachedImageFetcher::FetchSuggestionImage( |
| 183 const ContentSuggestion::ID& suggestion_id, | 183 const ContentSuggestion::ID& suggestion_id, |
| 184 const GURL& url, | 184 const GURL& url, |
| 185 const ImageFetchedCallback& callback) { | 185 const ImageFetchedCallback& callback) { |
| 186 database_->LoadImage( | 186 database_->LoadImage( |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 RemoteSuggestionsProviderImpl::CategoryContent::CategoryContent( | 1270 RemoteSuggestionsProviderImpl::CategoryContent::CategoryContent( |
| 1271 CategoryContent&&) = default; | 1271 CategoryContent&&) = default; |
| 1272 | 1272 |
| 1273 RemoteSuggestionsProviderImpl::CategoryContent::~CategoryContent() = default; | 1273 RemoteSuggestionsProviderImpl::CategoryContent::~CategoryContent() = default; |
| 1274 | 1274 |
| 1275 RemoteSuggestionsProviderImpl::CategoryContent& | 1275 RemoteSuggestionsProviderImpl::CategoryContent& |
| 1276 RemoteSuggestionsProviderImpl::CategoryContent::operator=(CategoryContent&&) = | 1276 RemoteSuggestionsProviderImpl::CategoryContent::operator=(CategoryContent&&) = |
| 1277 default; | 1277 default; |
| 1278 | 1278 |
| 1279 } // namespace ntp_snippets | 1279 } // namespace ntp_snippets |
| OLD | NEW |