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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/macros.h" | 13 #include "base/macros.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 enum class WebCachePolicy; |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 | 26 |
27 class ResourceFetcher; | 27 class AssociatedResourceFetcher; |
28 | 28 |
29 // A resource fetcher that returns all (differently-sized) frames in | 29 // A resource fetcher that returns all (differently-sized) frames in |
30 // an image. Useful for favicons. | 30 // an image. Useful for favicons. |
31 class MultiResolutionImageResourceFetcher { | 31 class MultiResolutionImageResourceFetcher { |
32 public: | 32 public: |
33 typedef base::Callback<void(MultiResolutionImageResourceFetcher*, | 33 typedef base::Callback<void(MultiResolutionImageResourceFetcher*, |
34 const std::vector<SkBitmap>&)> Callback; | 34 const std::vector<SkBitmap>&)> Callback; |
35 | 35 |
36 MultiResolutionImageResourceFetcher( | 36 MultiResolutionImageResourceFetcher( |
37 const GURL& image_url, | 37 const GURL& image_url, |
(...skipping 24 matching lines...) Expand all Loading... |
62 // Unique identifier for the request. | 62 // Unique identifier for the request. |
63 const int id_; | 63 const int id_; |
64 | 64 |
65 // HTTP status code upon fetch completion. | 65 // HTTP status code upon fetch completion. |
66 int http_status_code_; | 66 int http_status_code_; |
67 | 67 |
68 // URL of the image. | 68 // URL of the image. |
69 const GURL image_url_; | 69 const GURL image_url_; |
70 | 70 |
71 // Does the actual download. | 71 // Does the actual download. |
72 std::unique_ptr<ResourceFetcher> fetcher_; | 72 std::unique_ptr<AssociatedResourceFetcher> fetcher_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); | 74 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace content | 77 } // namespace content |
78 | 78 |
79 #endif // CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 79 #endif // CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
OLD | NEW |