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

Side by Side Diff: components/ntp_snippets/remote/remote_suggestions_provider_impl.cc

Issue 2715153006: Set desired_image_size when decoding images for NTP Tile icons. (Closed)
Patch Set: ax Created 3 years, 9 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 "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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 void CachedImageFetcher::OnSnippetImageFetchedFromDatabase( 213 void CachedImageFetcher::OnSnippetImageFetchedFromDatabase(
214 const ImageFetchedCallback& callback, 214 const ImageFetchedCallback& callback,
215 const ContentSuggestion::ID& suggestion_id, 215 const ContentSuggestion::ID& suggestion_id,
216 const GURL& url, 216 const GURL& url,
217 std::string data) { // SnippetImageCallback requires nonconst reference. 217 std::string data) { // SnippetImageCallback requires nonconst reference.
218 // |image_decoder_| is null in tests. 218 // |image_decoder_| is null in tests.
219 if (image_decoder_ && !data.empty()) { 219 if (image_decoder_ && !data.empty()) {
220 image_decoder_->DecodeImage( 220 image_decoder_->DecodeImage(
221 data, base::Bind(&CachedImageFetcher::OnSnippetImageDecodedFromDatabase, 221 data,
222 // We're not dealing with multi-frame images.
223 /*desired_image_frame_size=*/gfx::Size(),
224 base::Bind(&CachedImageFetcher::OnSnippetImageDecodedFromDatabase,
222 base::Unretained(this), callback, suggestion_id, url)); 225 base::Unretained(this), callback, suggestion_id, url));
223 return; 226 return;
224 } 227 }
225 // Fetching from the DB failed; start a network fetch. 228 // Fetching from the DB failed; start a network fetch.
226 FetchSnippetImageFromNetwork(suggestion_id, url, callback); 229 FetchSnippetImageFromNetwork(suggestion_id, url, callback);
227 } 230 }
228 231
229 void CachedImageFetcher::OnSnippetImageDecodedFromDatabase( 232 void CachedImageFetcher::OnSnippetImageDecodedFromDatabase(
230 const ImageFetchedCallback& callback, 233 const ImageFetchedCallback& callback,
231 const ContentSuggestion::ID& suggestion_id, 234 const ContentSuggestion::ID& suggestion_id,
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 RemoteSuggestionsProviderImpl::CategoryContent::CategoryContent( 1279 RemoteSuggestionsProviderImpl::CategoryContent::CategoryContent(
1277 CategoryContent&&) = default; 1280 CategoryContent&&) = default;
1278 1281
1279 RemoteSuggestionsProviderImpl::CategoryContent::~CategoryContent() = default; 1282 RemoteSuggestionsProviderImpl::CategoryContent::~CategoryContent() = default;
1280 1283
1281 RemoteSuggestionsProviderImpl::CategoryContent& 1284 RemoteSuggestionsProviderImpl::CategoryContent&
1282 RemoteSuggestionsProviderImpl::CategoryContent::operator=(CategoryContent&&) = 1285 RemoteSuggestionsProviderImpl::CategoryContent::operator=(CategoryContent&&) =
1283 default; 1286 default;
1284 1287
1285 } // namespace ntp_snippets 1288 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698