Chromium Code Reviews| Index: components/favicon_base/favicon_callback.h |
| diff --git a/components/favicon_base/favicon_callback.h b/components/favicon_base/favicon_callback.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0b549c2af5e325d7d8dbcb4a79e55dcdf1a9413e |
| --- /dev/null |
| +++ b/components/favicon_base/favicon_callback.h |
| @@ -0,0 +1,49 @@ |
| +// 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_FAVICON_BASE_FAVICON_CALLBACK_H_ |
| +#define COMPONENTS_FAVICON_BASE_FAVICON_CALLBACK_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/callback.h" |
| + |
| +namespace favicon_base { |
| + |
| +struct FaviconBitmapResult; |
| +struct FaviconImageResult; |
| + |
| +// Callback for FaviconService::GetFaviconImage(), |
| +// FaviconService::GetFaviconImageForURL() and |
| +// BookmarkClient::GetFaviconImageForURL(). |
| +// |FaviconImageResult::image| is constructed from the bitmaps for the |
| +// passed in URL and icon types which most which closely match the passed in |
| +// |desired_size_in_dip| at the scale factors supported by the current |
| +// platform (eg MacOS) in addition to 1x. |
| +// |FaviconImageResult::icon_url| is the favicon that the favicon bitmaps in |
| +// |image| originate from. |
| +// TODO(pkotwicz): Enable constructing |image| from bitmaps from several |
| +// icon URLs. |
| +typedef base::Callback<void(const FaviconImageResult&)> FaviconImageCallback; |
| + |
| +// Callback for GetRawFavicon(), GetRawFaviconForURL() and |
| +// GetLargestRawFavicon(). |
| +// See function for details on value. |
| +typedef base::Callback<void(const FaviconBitmapResult&)> FaviconRawCallback; |
| + |
| +// Callback for GetFavicon() and GetFaviconForURL(). |
| +// |
| +// The first argument is the set of bitmaps for the passed in URL and |
| +// icon types whose pixel sizes best match the passed in |
| +// |desired_size_in_dip| at the scale factors supported by the current |
| +// platform (eg MacOS) in addition to 1x. The vector has at most one result |
| +// for each of the scale factors. There are less entries if a single result |
| +// is the best bitmap to use for several scale factors. |
| +typedef base::Callback<void(const std::vector<FaviconBitmapResult>&)> |
| + FaviconResultsCallback; |
| + |
| +} // namespace favicon_base |
| + |
| +#endif // COMPONENTS_FAVICON_BASE_FAVICON_CALLBACK_H_ |
| + |
|
tfarina
2014/05/16 20:30:17
nit: remove trailing new line.
Jiang Jiang
2014/05/16 20:56:16
Done.
|