summaryrefslogtreecommitdiffstats
path: root/components/suggestions/image_fetcher.h
blob: 52fcff4f67da49a4c54ebb44d8c9e3960c17cb18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_SUGGESTIONS_IMAGE_FETCHER_H_
#define COMPONENTS_SUGGESTIONS_IMAGE_FETCHER_H_

#include "base/callback.h"
#include "components/suggestions/image_fetcher_delegate.h"
#include "url/gurl.h"

class SkBitmap;

namespace suggestions {

// A class used to fetch server images.
class ImageFetcher {
 public:
  ImageFetcher() {}
  virtual ~ImageFetcher() {}

  virtual void SetImageFetcherDelegate(ImageFetcherDelegate* delegate) = 0;

  virtual void StartOrQueueNetworkRequest(
      const GURL& url, const GURL& image_url,
      base::Callback<void(const GURL&, const SkBitmap*)> callback) = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(ImageFetcher);
};

}  // namespace suggestions

#endif  // COMPONENTS_SUGGESTIONS_IMAGE_FETCHER_H_