| OLD | NEW |
| 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 #include <UIKit/UIKit.h> | 7 #include <UIKit/UIKit.h> |
| 8 | 8 |
| 9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "components/image_fetcher/image_fetcher_delegate.h" | 10 #include "components/image_fetcher/image_fetcher_delegate.h" |
| 11 #include "ios/chrome/browser/net/image_fetcher.h" | 11 #include "ios/chrome/browser/net/image_fetcher/image_fetcher.h" |
| 12 #include "net/url_request/url_request_context_getter.h" | 12 #include "net/url_request/url_request_context_getter.h" |
| 13 #include "skia/ext/skia_utils_ios.h" | 13 #include "skia/ext/skia_utils_ios.h" |
| 14 #include "ui/gfx/image/image.h" | 14 #include "ui/gfx/image/image.h" |
| 15 | 15 |
| 16 namespace suggestions { | 16 namespace suggestions { |
| 17 | 17 |
| 18 ImageFetcherImpl::ImageFetcherImpl( | 18 ImageFetcherImpl::ImageFetcherImpl( |
| 19 net::URLRequestContextGetter* url_request_context, | 19 net::URLRequestContextGetter* url_request_context, |
| 20 base::SequencedWorkerPool* blocking_pool) { | 20 base::SequencedWorkerPool* blocking_pool) { |
| 21 imageFetcher_.reset(new ::ImageFetcher(blocking_pool)); | 21 imageFetcher_.reset(new ::ImageFetcher(blocking_pool)); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 gfx::Image empty_image; | 69 gfx::Image empty_image; |
| 70 callback.Run(fetch_id, empty_image); | 70 callback.Run(fetch_id, empty_image); |
| 71 if (delegate_) { | 71 if (delegate_) { |
| 72 delegate_->OnImageFetched(fetch_id, empty_image); | 72 delegate_->OnImageFetched(fetch_id, empty_image); |
| 73 } | 73 } |
| 74 }; | 74 }; |
| 75 imageFetcher_->StartDownload(image_url, fetcher_callback); | 75 imageFetcher_->StartDownload(image_url, fetcher_callback); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace suggestions | 78 } // namespace suggestions |
| OLD | NEW |