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

Unified Diff: webkit/glue/multi_resolution_image_resource_fetcher.h

Issue 10853010: Add webkit/ api to request all frames in an image. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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
« no previous file with comments | « webkit/glue/image_decoder.cc ('k') | webkit/glue/multi_resolution_image_resource_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/multi_resolution_image_resource_fetcher.h
diff --git a/webkit/glue/image_resource_fetcher.h b/webkit/glue/multi_resolution_image_resource_fetcher.h
similarity index 57%
copy from webkit/glue/image_resource_fetcher.h
copy to webkit/glue/multi_resolution_image_resource_fetcher.h
index d1a4f7d6eac8c38f2cd3edd0b36da59cdeb21286..23f8073fb55ecdd7a88eed007569186eea7a511e 100644
--- a/webkit/glue/image_resource_fetcher.h
+++ b/webkit/glue/multi_resolution_image_resource_fetcher.h
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_
-#define WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_
+#ifndef WEBKIT_GLUE_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_
+#define WEBKIT_GLUE_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_
+
+#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
@@ -14,22 +16,21 @@ class SkBitmap;
namespace webkit_glue {
-// ImageResourceFetcher handles downloading an image for a webview. Once
-// downloading is done the supplied callback is notified. ImageResourceFetcher
-// is used to download the favicon and images for web apps.
-class ImageResourceFetcher {
+// A resource fetcher that returns all (differently-sized) frames in
+// an image. Useful for favicons.
+class MultiResolutionImageResourceFetcher{
public:
- typedef base::Callback<void(ImageResourceFetcher*, const SkBitmap&)> Callback;
+ typedef base::Callback<void(MultiResolutionImageResourceFetcher*,
+ const std::vector<SkBitmap>&)> Callback;
- WEBKIT_GLUE_EXPORT ImageResourceFetcher(
+ WEBKIT_GLUE_EXPORT MultiResolutionImageResourceFetcher(
const GURL& image_url,
WebKit::WebFrame* frame,
int id,
- int image_size,
WebKit::WebURLRequest::TargetType target_type,
const Callback& callback);
- WEBKIT_GLUE_EXPORT virtual ~ImageResourceFetcher();
+ WEBKIT_GLUE_EXPORT virtual ~MultiResolutionImageResourceFetcher();
// URL of the image we're downloading.
const GURL& image_url() const { return image_url_; }
@@ -50,17 +51,12 @@ class ImageResourceFetcher {
// URL of the image.
const GURL image_url_;
- // The size of the image. This is only a hint that is used if the image
- // contains multiple sizes. A value of 0 results in using the first frame
- // of the image.
- const int image_size_;
-
// Does the actual download.
scoped_ptr<ResourceFetcher> fetcher_;
- DISALLOW_COPY_AND_ASSIGN(ImageResourceFetcher);
+ DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher);
};
} // namespace webkit_glue
-#endif // WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_
+#endif // WEBKIT_GLUE_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_
« no previous file with comments | « webkit/glue/image_decoder.cc ('k') | webkit/glue/multi_resolution_image_resource_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698