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 COMPONENTS_FAVICON_BASE_FAVICON_CALLBACK_H_
6 #define COMPONENTS_FAVICON_BASE_FAVICON_CALLBACK_H_
10 #include "base/callback.h"
12 namespace favicon_base {
14 struct FaviconRawBitmapResult;
15 struct FaviconImageResult;
16 struct LargeIconResult;
17 struct LargeIconImageResult;
18 enum class GoogleFaviconServerRequestStatus;
20 // Callback for functions that can be used to return a |gfx::Image| and the
21 // |GURL| it is loaded from. They are returned as a |FaviconImageResult| object.
22 typedef base::Callback<void(const FaviconImageResult&)> FaviconImageCallback;
24 // Callback for functions returning raw data for a favicon. In
25 // |FaviconRawBitmapResult|, the data is not yet converted as a |gfx::Image|.
26 typedef base::Callback<void(const FaviconRawBitmapResult&)>
27 FaviconRawBitmapCallback;
29 // Callback for functions returning raw data for a favicon in multiple
30 // resolution. In |FaviconRawBitmapResult|, the data is not yet converted as a
32 typedef base::Callback<void(const std::vector<FaviconRawBitmapResult>&)>
33 FaviconResultsCallback;
35 // Callback for functions returning data for a large icon. |LargeIconResult|
36 // will contain either the raw bitmap for a large icon or the style of the
37 // fallback to use if a sufficiently large icon could not be found.
38 // TODO(jkrcal): Rename LargeIcon* to LargeIconRawBitmap*.
39 typedef base::Callback<void(const LargeIconResult&)> LargeIconCallback;
41 // Callback for functions returning decoded data for a large icon.
42 // |LargeIconImageResult| will contain either the decoded image of a large
43 // icon or the style of the fallback to use if a sufficiently large icon could
45 typedef base::Callback<void(const LargeIconImageResult&)>
46 LargeIconImageCallback;
48 typedef base::Callback<void(GoogleFaviconServerRequestStatus)>
49 GoogleFaviconServerCallback;
51 } // namespace favicon_base
53 #endif // COMPONENTS_FAVICON_BASE_FAVICON_CALLBACK_H_