Chromium Code Reviews| 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 #ifndef IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ | 5 #ifndef IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
| 6 #define IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ | 6 #define IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "components/image_fetcher/image_fetcher.h" | 12 #include "components/image_fetcher/image_fetcher.h" |
| 13 #include "ui/gfx/image/image.h" | |
|
Marc Treib
2016/05/13 15:54:00
nit: forward-declare; no need to include here
markusheintz_
2016/05/17 13:08:23
Done.
| |
| 13 | 14 |
| 14 class GURL; | 15 class GURL; |
| 15 class ImageFetcher; | 16 class ImageFetcher; |
| 16 class SkBitmap; | 17 |
| 18 namespace base { | |
| 19 class SequencedWorkerPool; | |
| 20 } | |
| 17 | 21 |
| 18 namespace image_fetcher { | 22 namespace image_fetcher { |
| 19 class ImageFetcherDelegate; | 23 class ImageFetcherDelegate; |
| 20 } | 24 } |
| 21 | 25 |
| 22 namespace base { | |
| 23 class SequencedWorkerPool; | |
| 24 } | |
| 25 | |
| 26 namespace net { | 26 namespace net { |
| 27 class URLRequestContextGetter; | 27 class URLRequestContextGetter; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace suggestions { | 30 namespace suggestions { |
| 31 | 31 |
| 32 // A class used to fetch server images asynchronously. | 32 // A class used to fetch server images asynchronously. |
| 33 class ImageFetcherImpl : public image_fetcher::ImageFetcher { | 33 class ImageFetcherImpl : public image_fetcher::ImageFetcher { |
| 34 public: | 34 public: |
| 35 ImageFetcherImpl(net::URLRequestContextGetter* url_request_context, | 35 ImageFetcherImpl(net::URLRequestContextGetter* url_request_context, |
| 36 base::SequencedWorkerPool* blocking_pool); | 36 base::SequencedWorkerPool* blocking_pool); |
| 37 ~ImageFetcherImpl() override; | 37 ~ImageFetcherImpl() override; |
| 38 | 38 |
| 39 void SetImageFetcherDelegate( | 39 void SetImageFetcherDelegate( |
| 40 image_fetcher::ImageFetcherDelegate* delegate) override; | 40 image_fetcher::ImageFetcherDelegate* delegate) override; |
| 41 | 41 |
| 42 void StartOrQueueNetworkRequest( | 42 void StartOrQueueNetworkRequest( |
| 43 const GURL& url, | 43 const GURL& url, |
| 44 const GURL& image_url, | 44 const GURL& image_url, |
| 45 base::Callback<void(const GURL&, const SkBitmap*)> callback) override; | 45 base::Callback<void(const GURL&, const gfx::Image&)> callback) override; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 std::unique_ptr<::ImageFetcher> imageFetcher_; | 48 std::unique_ptr<::ImageFetcher> imageFetcher_; |
| 49 | 49 |
| 50 image_fetcher::ImageFetcherDelegate* delegate_; | 50 image_fetcher::ImageFetcherDelegate* delegate_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(ImageFetcherImpl); | 52 DISALLOW_COPY_AND_ASSIGN(ImageFetcherImpl); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace suggestions | 55 } // namespace suggestions |
| 56 | 56 |
| 57 #endif // IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ | 57 #endif // IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
| OLD | NEW |