OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ |
6 #define CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ | 6 #define CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ |
7 | 7 |
8 #include "content/common/image_downloader/image_downloader.mojom.h" | 8 #include "content/common/image_downloader/image_downloader.mojom.h" |
9 #include "content/renderer/image_downloader/image_downloader_base.h" | 9 #include "content/renderer/image_downloader/image_downloader_base.h" |
10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 mojom::ImageDownloaderRequest request); | 24 mojom::ImageDownloaderRequest request); |
25 | 25 |
26 // Override ImageDownloaderBase::OnDestruct(). | 26 // Override ImageDownloaderBase::OnDestruct(). |
27 void OnDestruct() override; | 27 void OnDestruct() override; |
28 | 28 |
29 // ImageDownloader implementation. | 29 // ImageDownloader implementation. |
30 void DownloadImage(const GURL& url, | 30 void DownloadImage(const GURL& url, |
31 bool is_favicon, | 31 bool is_favicon, |
32 uint32_t max_bitmap_size, | 32 uint32_t max_bitmap_size, |
33 bool bypass_cache, | 33 bool bypass_cache, |
34 const DownloadImageCallback& callback) override; | 34 DownloadImageCallback callback) override; |
35 | 35 |
36 // Called when downloading finishes. All frames in |images| whose size <= | 36 // Called when downloading finishes. All frames in |images| whose size <= |
37 // |max_image_size| will be returned through |callback|. If all of the frames | 37 // |max_image_size| will be returned through |callback|. If all of the frames |
38 // are larger than |max_image_size|, the smallest frame is resized to | 38 // are larger than |max_image_size|, the smallest frame is resized to |
39 // |max_image_size| and is the only result. |max_image_size| == 0 is | 39 // |max_image_size| and is the only result. |max_image_size| == 0 is |
40 // interpreted as no max image size. | 40 // interpreted as no max image size. |
41 void DidDownloadImage(uint32_t max_bitmap_size, | 41 void DidDownloadImage(uint32_t max_bitmap_size, |
42 const DownloadImageCallback& callback, | 42 DownloadImageCallback callback, |
43 int32_t http_status_code, | 43 int32_t http_status_code, |
44 const std::vector<SkBitmap>& images); | 44 const std::vector<SkBitmap>& images); |
45 | 45 |
46 mojo::Binding<mojom::ImageDownloader> binding_; | 46 mojo::Binding<mojom::ImageDownloader> binding_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(ImageDownloaderImpl); | 48 DISALLOW_COPY_AND_ASSIGN(ImageDownloaderImpl); |
49 }; | 49 }; |
50 | 50 |
51 } // namespace content | 51 } // namespace content |
52 | 52 |
53 #endif // CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ | 53 #endif // CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ |
OLD | NEW |