Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: components/favicon_base/favicon_callback.h

Issue 291643002: Move favicon callbacks to favicon_base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android unittest Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..90de9f0221eaaee424f74dae50f3070726461b02
--- /dev/null
+++ b/components/favicon_base/favicon_callback.h
@@ -0,0 +1,48 @@
+// 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(),
blundell 2014/05/19 07:50:30 Hmm, these comments are not the right ones now tha
sdefresne 2014/05/19 14:36:39 I'd got with something like: // Callback for func
blundell 2014/05/19 15:12:59 s/for functions returning/that can be used to retu
Jiang Jiang 2014/05/19 15:56:41 Done.
+// 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
sdefresne 2014/05/19 14:36:39 // Callback for functions returning raw data for a
blundell 2014/05/19 15:12:59 Sylvain, what is raw data? is there any way to be
sdefresne 2014/05/19 16:30:04 FaviconBitmapResult does not store the favicon as
+// GetLargestRawFavicon().
+// See function for details on value.
+typedef base::Callback<void(const FaviconBitmapResult&)> FaviconRawCallback;
+
+// Callback for GetFavicon() and GetFaviconForURL().
sdefresne 2014/05/19 14:36:39 // Callback for functions returning raw data for a
blundell 2014/05/19 15:12:59 same question as above for Sylvain On 2014/05/19
+//
+// 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_

Powered by Google App Engine
This is Rietveld 408576698