summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bitmap_fetcher_delegate.h
blob: a91d3206f4d55a5b6b870ab5cdf0b42fe3ca3bdd (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
// 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 CHROME_BROWSER_BITMAP_FETCHER_DELEGATE_H_
#define CHROME_BROWSER_BITMAP_FETCHER_DELEGATE_H_

#include "url/gurl.h"

class SkBitmap;

namespace chrome {

// A delegate interface for users of BitmapFetcher.
class BitmapFetcherDelegate {
 public:
  BitmapFetcherDelegate() {}

  // This will be called when the bitmap has been requested, whether or not the
  // request succeeds.  |url| is the URL that was originally fetched so we can
  // match up the bitmap with a specific request.  |bitmap| may be NULL if the
  // image fails to be downloaded or decoded.
  virtual void OnFetchComplete(const GURL url, const SkBitmap* bitmap) = 0;

 protected:
  virtual ~BitmapFetcherDelegate() {}

  DISALLOW_COPY_AND_ASSIGN(BitmapFetcherDelegate);
};

}  // namespace chrome

#endif  // CHROME_BROWSER_BITMAP_FETCHER_DELEGATE_H_