OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 5 #ifndef CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
6 #define CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 6 #define CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 14 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
17 class SkBitmap; | 17 class SkBitmap; |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 class WebFrame; | 20 class WebFrame; |
21 class WebURLResponse; | 21 class WebURLResponse; |
| 22 enum class WebCachePolicy; |
22 } | 23 } |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 | 26 |
26 class ResourceFetcher; | 27 class ResourceFetcher; |
27 | 28 |
28 // A resource fetcher that returns all (differently-sized) frames in | 29 // A resource fetcher that returns all (differently-sized) frames in |
29 // an image. Useful for favicons. | 30 // an image. Useful for favicons. |
30 class MultiResolutionImageResourceFetcher { | 31 class MultiResolutionImageResourceFetcher { |
31 public: | 32 public: |
32 typedef base::Callback<void(MultiResolutionImageResourceFetcher*, | 33 typedef base::Callback<void(MultiResolutionImageResourceFetcher*, |
33 const std::vector<SkBitmap>&)> Callback; | 34 const std::vector<SkBitmap>&)> Callback; |
34 | 35 |
35 MultiResolutionImageResourceFetcher( | 36 MultiResolutionImageResourceFetcher( |
36 const GURL& image_url, | 37 const GURL& image_url, |
37 blink::WebFrame* frame, | 38 blink::WebFrame* frame, |
38 int id, | 39 int id, |
39 blink::WebURLRequest::RequestContext request_context, | 40 blink::WebURLRequest::RequestContext request_context, |
40 blink::WebURLRequest::CachePolicy cache_policy, | 41 blink::WebCachePolicy cache_policy, |
41 const Callback& callback); | 42 const Callback& callback); |
42 | 43 |
43 virtual ~MultiResolutionImageResourceFetcher(); | 44 virtual ~MultiResolutionImageResourceFetcher(); |
44 | 45 |
45 // URL of the image we're downloading. | 46 // URL of the image we're downloading. |
46 const GURL& image_url() const { return image_url_; } | 47 const GURL& image_url() const { return image_url_; } |
47 | 48 |
48 // Unique identifier for the request. | 49 // Unique identifier for the request. |
49 int id() const { return id_; } | 50 int id() const { return id_; } |
50 | 51 |
(...skipping 18 matching lines...) Expand all Loading... |
69 | 70 |
70 // Does the actual download. | 71 // Does the actual download. |
71 scoped_ptr<ResourceFetcher> fetcher_; | 72 scoped_ptr<ResourceFetcher> fetcher_; |
72 | 73 |
73 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); | 74 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); |
74 }; | 75 }; |
75 | 76 |
76 } // namespace content | 77 } // namespace content |
77 | 78 |
78 #endif // CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 79 #endif // CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
OLD | NEW |