OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class FilePath; | 13 class FilePath; |
14 } | 14 } |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class Image; | 17 class Image; |
18 } | 18 } |
19 | 19 |
| 20 class GURL; |
20 class SkBitmap; | 21 class SkBitmap; |
21 | 22 |
22 namespace profiles { | 23 namespace profiles { |
23 | 24 |
24 // Avatar access. | 25 // Avatar access. |
25 extern const char kGAIAPictureFileName[]; | 26 extern const char kGAIAPictureFileName[]; |
26 extern const char kHighResAvatarFolderName[]; | 27 extern const char kHighResAvatarFolderName[]; |
27 | 28 |
28 // Avatar formatting. | 29 // Avatar formatting. |
29 extern const int kAvatarIconWidth; | 30 extern const int kAvatarIconWidth; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Returns a URL for the default avatar icon with specified index. | 85 // Returns a URL for the default avatar icon with specified index. |
85 std::string GetDefaultAvatarIconUrl(size_t index); | 86 std::string GetDefaultAvatarIconUrl(size_t index); |
86 | 87 |
87 // Checks if |index| is a valid avatar icon index | 88 // Checks if |index| is a valid avatar icon index |
88 bool IsDefaultAvatarIconIndex(size_t index); | 89 bool IsDefaultAvatarIconIndex(size_t index); |
89 | 90 |
90 // Checks if the given URL points to one of the default avatar icons. If it | 91 // Checks if the given URL points to one of the default avatar icons. If it |
91 // is, returns true and its index through |icon_index|. If not, returns false. | 92 // is, returns true and its index through |icon_index|. If not, returns false. |
92 bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index); | 93 bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index); |
93 | 94 |
| 95 // Given an image URL this function builds a new URL set to |thumbnail_size|. |
| 96 // For example, if |thumbnail_size| was set to 256 and |old_url| was either: |
| 97 // https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg |
| 98 // or |
| 99 // https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s64-c/photo.jpg |
| 100 // then return value in |new_url| would be: |
| 101 // https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s256-c/photo.jpg |
| 102 bool GetImageURLWithThumbnailSize( |
| 103 const GURL& old_url, int thumbnail_size, GURL* new_url); |
| 104 |
94 } // namespace profiles | 105 } // namespace profiles |
95 | 106 |
96 #endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ | 107 #endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ |
OLD | NEW |