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

Side by Side Diff: ios/chrome/browser/suggestions/image_fetcher_impl.mm

Issue 2638413006: Add ContentSuggestionsMediator (Closed)
Patch Set: Fix 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/suggestions/image_fetcher_impl.h" 5 #include "ios/chrome/browser/suggestions/image_fetcher_impl.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 22 matching lines...) Expand all
33 void ImageFetcherImpl::SetImageFetcherDelegate( 33 void ImageFetcherImpl::SetImageFetcherDelegate(
34 image_fetcher::ImageFetcherDelegate* delegate) { 34 image_fetcher::ImageFetcherDelegate* delegate) {
35 DCHECK(delegate); 35 DCHECK(delegate);
36 delegate_ = delegate; 36 delegate_ = delegate;
37 } 37 }
38 38
39 void ImageFetcherImpl::SetDataUseServiceName( 39 void ImageFetcherImpl::SetDataUseServiceName(
40 DataUseServiceName data_use_service_name) { 40 DataUseServiceName data_use_service_name) {
41 // Not implemented - will be obsolete once iOS also uses 41 // Not implemented - will be obsolete once iOS also uses
42 // image_fetcher::ImageDataFetcher. 42 // image_fetcher::ImageDataFetcher.
43 NOTREACHED();
lpromero 2017/01/26 10:10:20 What is the context of this change? Is it related
gambard 2017/01/30 15:19:17 It will be handled in https://codereview.chromium.
44 } 43 }
45 44
46 void ImageFetcherImpl::StartOrQueueNetworkRequest( 45 void ImageFetcherImpl::StartOrQueueNetworkRequest(
47 const std::string& id, 46 const std::string& id,
48 const GURL& image_url, 47 const GURL& image_url,
49 base::Callback<void(const std::string&, const gfx::Image&)> callback) { 48 base::Callback<void(const std::string&, const gfx::Image&)> callback) {
50 if (image_url.is_empty()) { 49 if (image_url.is_empty()) {
51 gfx::Image empty_image; 50 gfx::Image empty_image;
52 callback.Run(id, empty_image); 51 callback.Run(id, empty_image);
53 if (delegate_) { 52 if (delegate_) {
(...skipping 22 matching lines...) Expand all
76 gfx::Image empty_image; 75 gfx::Image empty_image;
77 callback.Run(fetch_id, empty_image); 76 callback.Run(fetch_id, empty_image);
78 if (delegate_) { 77 if (delegate_) {
79 delegate_->OnImageFetched(fetch_id, empty_image); 78 delegate_->OnImageFetched(fetch_id, empty_image);
80 } 79 }
81 }; 80 };
82 image_fetcher_->StartDownload(image_url, fetcher_callback); 81 image_fetcher_->StartDownload(image_url, fetcher_callback);
83 } 82 }
84 83
85 } // namespace suggestions 84 } // namespace suggestions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698