Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / chrome / browser / suggestions / image_fetcher_impl.h
blob6a6ecedb7e0990ba6dab8ea6ecf775c1a53722c4
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.
5 #ifndef IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_
6 #define IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_
8 #include "base/callback_forward.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/suggestions/image_fetcher.h"
12 class GURL;
13 class SkBitmap;
15 namespace image_fetcher {
16 class ImageFetcher;
19 namespace base {
20 class SequencedWorkerPool;
23 namespace net {
24 class URLRequestContextGetter;
27 namespace suggestions {
29 class ImageFetcherDelegate;
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;
38 void SetImageFetcherDelegate(ImageFetcherDelegate* delegate) override;
40 void StartOrQueueNetworkRequest(
41 const GURL& url,
42 const GURL& image_url,
43 base::Callback<void(const GURL&, const SkBitmap*)> callback) override;
45 private:
46 scoped_ptr<image_fetcher::ImageFetcher> imageFetcher_;
48 ImageFetcherDelegate* delegate_;
50 DISALLOW_COPY_AND_ASSIGN(ImageFetcherImpl);
53 } // namespace suggestions
55 #endif // IOS_CHROME_BROWSER_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_