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 CHROME_BROWSER_MANIFEST_MANIFEST_ICON_DOWNLOADER_H_ | 5 #ifndef CHROME_BROWSER_MANIFEST_MANIFEST_ICON_DOWNLOADER_H_ |
please use gerrit instead
2017/06/12 23:57:22
Update the header guards.
zino
2017/06/13 16:07:45
Done.
| |
6 #define CHROME_BROWSER_MANIFEST_MANIFEST_ICON_DOWNLOADER_H_ | 6 #define CHROME_BROWSER_MANIFEST_MANIFEST_ICON_DOWNLOADER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "content/common/content_export.h" | |
12 | 13 |
13 class SkBitmap; | 14 class SkBitmap; |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 class WebContents; | 17 class WebContents; |
17 } // namespace content | 18 } // namespace content |
18 | 19 |
19 namespace gfx { | 20 namespace gfx { |
20 class Size; | 21 class Size; |
21 } // namespace gfx | 22 } // namespace gfx |
22 | 23 |
23 class GURL; | 24 class GURL; |
24 | 25 |
26 namespace content { | |
please use gerrit instead
2017/06/12 23:57:22
newline below
zino
2017/06/13 16:07:45
Done.
| |
25 // Helper class which downloads the icon located at a specified. If the icon | 27 // Helper class which downloads the icon located at a specified. If the icon |
26 // file contains multiple icons then it attempts to pick the one closest in size | 28 // file contains multiple icons then it attempts to pick the one closest in size |
27 // bigger than or equal to ideal_icon_size_in_px, taking into account the | 29 // bigger than or equal to ideal_icon_size_in_px, taking into account the |
28 // density of the device. If a bigger icon is chosen then, the icon is scaled | 30 // density of the device. If a bigger icon is chosen then, the icon is scaled |
29 // down to be equal to ideal_icon_size_in_px. Smaller icons will be chosen down | 31 // down to be equal to ideal_icon_size_in_px. Smaller icons will be chosen down |
30 // to the value specified by |minimum_icon_size_in_px|. | 32 // to the value specified by |minimum_icon_size_in_px|. |
31 class ManifestIconDownloader final { | 33 class CONTENT_EXPORT ManifestIconDownloader final { |
32 public: | 34 public: |
33 using IconFetchCallback = base::Callback<void(const SkBitmap&)>; | 35 using IconFetchCallback = base::Callback<void(const SkBitmap&)>; |
34 | 36 |
35 ManifestIconDownloader() = delete; | 37 ManifestIconDownloader() = delete; |
36 ~ManifestIconDownloader() = delete; | 38 ~ManifestIconDownloader() = delete; |
37 | 39 |
38 // Returns whether the download has started. | 40 // Returns whether the download has started. |
39 // It will return false if the current context or information do not allow to | 41 // It will return false if the current context or information do not allow to |
40 // download the image. | 42 // download the image. |
41 static bool Download(content::WebContents* web_contents, | 43 static bool Download(content::WebContents* web_contents, |
(...skipping 23 matching lines...) Expand all Loading... | |
65 | 67 |
66 static int FindClosestBitmapIndex(int ideal_icon_size_in_px, | 68 static int FindClosestBitmapIndex(int ideal_icon_size_in_px, |
67 int minimum_icon_size_in_px, | 69 int minimum_icon_size_in_px, |
68 const std::vector<SkBitmap>& bitmaps); | 70 const std::vector<SkBitmap>& bitmaps); |
69 | 71 |
70 friend class ManifestIconDownloaderTest; | 72 friend class ManifestIconDownloaderTest; |
71 | 73 |
72 DISALLOW_COPY_AND_ASSIGN(ManifestIconDownloader); | 74 DISALLOW_COPY_AND_ASSIGN(ManifestIconDownloader); |
73 }; | 75 }; |
74 | 76 |
77 } // namespace content | |
78 | |
75 #endif // CHROME_BROWSER_MANIFEST_MANIFEST_ICON_DOWNLOADER_H_ | 79 #endif // CHROME_BROWSER_MANIFEST_MANIFEST_ICON_DOWNLOADER_H_ |
OLD | NEW |