| 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/WebCachePolicy.h" | 14 #include "third_party/WebKit/public/platform/WebCachePolicy.h" |
| 15 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 15 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 class SkBitmap; | 18 class SkBitmap; |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 class WebFrame; | 21 class WebLocalFrame; |
| 22 class WebURLResponse; | 22 class WebURLResponse; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 | 26 |
| 27 class AssociatedResourceFetcher; | 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, |
| 38 blink::WebFrame* frame, | 38 blink::WebLocalFrame* frame, |
| 39 int id, | 39 int id, |
| 40 blink::WebURLRequest::RequestContext request_context, | 40 blink::WebURLRequest::RequestContext request_context, |
| 41 blink::WebCachePolicy cache_policy, | 41 blink::WebCachePolicy cache_policy, |
| 42 const Callback& callback); | 42 const Callback& callback); |
| 43 | 43 |
| 44 virtual ~MultiResolutionImageResourceFetcher(); | 44 virtual ~MultiResolutionImageResourceFetcher(); |
| 45 | 45 |
| 46 // URL of the image we're downloading. | 46 // URL of the image we're downloading. |
| 47 const GURL& image_url() const { return image_url_; } | 47 const GURL& image_url() const { return image_url_; } |
| 48 | 48 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 73 | 73 |
| 74 // Does the actual download. | 74 // Does the actual download. |
| 75 std::unique_ptr<AssociatedResourceFetcher> fetcher_; | 75 std::unique_ptr<AssociatedResourceFetcher> fetcher_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); | 77 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace content | 80 } // namespace content |
| 81 | 81 |
| 82 #endif // CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 82 #endif // CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
| OLD | NEW |