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"
15 namespace image_fetcher
{
20 class SequencedWorkerPool
;
24 class URLRequestContextGetter
;
27 namespace suggestions
{
29 class ImageFetcherDelegate
;
31 // A class used to fetch server images asynchronously.
32 class ImageFetcherImpl
: public suggestions::ImageFetcher
{
34 ImageFetcherImpl(net::URLRequestContextGetter
* url_request_context
,
35 base::SequencedWorkerPool
* blocking_pool
);
36 ~ImageFetcherImpl() override
;
38 void SetImageFetcherDelegate(ImageFetcherDelegate
* delegate
) override
;
40 void StartOrQueueNetworkRequest(
42 const GURL
& image_url
,
43 base::Callback
<void(const GURL
&, const SkBitmap
*)> callback
) override
;
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_