OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
| 6 #define IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/suggestions/image_fetcher.h" |
| 11 |
| 12 class GURL; |
| 13 class SkBitmap; |
| 14 |
| 15 namespace image_fetcher { |
| 16 class ImageFetcher; |
| 17 } |
| 18 |
| 19 namespace base { |
| 20 class SequencedWorkerPool; |
| 21 } |
| 22 |
| 23 namespace net { |
| 24 class URLRequestContextGetter; |
| 25 } |
| 26 |
| 27 namespace suggestions { |
| 28 |
| 29 class ImageFetcherDelegate; |
| 30 |
| 31 // A class used to fetch server images asynchronously. |
| 32 class ImageFetcherImpl : public suggestions::ImageFetcher { |
| 33 public: |
| 34 ImageFetcherImpl(net::URLRequestContextGetter* url_request_context, |
| 35 base::SequencedWorkerPool* blocking_pool); |
| 36 ~ImageFetcherImpl() override; |
| 37 |
| 38 void SetImageFetcherDelegate(ImageFetcherDelegate* delegate) override; |
| 39 |
| 40 void StartOrQueueNetworkRequest( |
| 41 const GURL& url, |
| 42 const GURL& image_url, |
| 43 base::Callback<void(const GURL&, const SkBitmap*)> callback) override; |
| 44 |
| 45 private: |
| 46 scoped_ptr<image_fetcher::ImageFetcher> imageFetcher_; |
| 47 |
| 48 ImageFetcherDelegate* delegate_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(ImageFetcherImpl); |
| 51 }; |
| 52 |
| 53 } // namespace suggestions |
| 54 |
| 55 #endif // IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
OLD | NEW |