Add ICU message format support
[chromium-blink-merge.git] / chrome / browser / profiles / profile_avatar_icon_util.h
blob99ca49b298054600166cd23829085cfa76f523b2
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_
8 #include <string>
10 #include "third_party/skia/include/core/SkColor.h"
12 namespace base {
13 class FilePath;
16 namespace gfx {
17 class Image;
20 class SkBitmap;
22 namespace profiles {
24 // Avatar access.
25 extern const char kGAIAPictureFileName[];
26 extern const char kHighResAvatarFolderName[];
28 // Avatar formatting.
29 extern const int kAvatarIconWidth;
30 extern const int kAvatarIconHeight;
31 extern const SkColor kAvatarTutorialBackgroundColor;
32 extern const SkColor kAvatarTutorialContentTextColor;
33 extern const SkColor kAvatarBubbleAccountsBackgroundColor;
34 extern const SkColor kAvatarBubbleGaiaBackgroundColor;
35 extern const SkColor kUserManagerBackgroundColor;
37 // Returns a version of |image| of a specific size. Note that no checks are
38 // done on the width/height so make sure they're reasonable values; in the
39 // range of 16-256 is probably best.
40 gfx::Image GetSizedAvatarIcon(const gfx::Image& image,
41 bool is_rectangle,
42 int width, int height);
44 // Returns a version of |image| suitable for use in menus.
45 gfx::Image GetAvatarIconForMenu(const gfx::Image& image,
46 bool is_rectangle);
48 // Returns a version of |image| suitable for use in WebUI.
49 gfx::Image GetAvatarIconForWebUI(const gfx::Image& image,
50 bool is_rectangle);
52 // Returns a version of |image| suitable for use in title bars. The returned
53 // image is scaled to fit |dst_width| and |dst_height|.
54 gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
55 bool is_rectangle,
56 int dst_width,
57 int dst_height);
59 // Returns a bitmap with a couple of columns shaved off so it is more square,
60 // so that when resized to a square aspect ratio it looks pretty.
61 SkBitmap GetAvatarIconAsSquare(const SkBitmap& source_bitmap, int scale_factor);
63 // Gets the number of default avatar icons that exist.
64 size_t GetDefaultAvatarIconCount();
66 // Gets the number of generic avatar icons that exist.
67 size_t GetGenericAvatarIconCount();
69 // Gets the index for the (grey silhouette) avatar used as a placeholder.
70 size_t GetPlaceholderAvatarIndex();
72 // Gets the resource ID of the placeholder avatar icon.
73 int GetPlaceholderAvatarIconResourceID();
75 // Gets the resource ID of the default avatar icon at |index|.
76 int GetDefaultAvatarIconResourceIDAtIndex(size_t index);
78 // Gets the resource filename of the default avatar icon at |index|.
79 const char* GetDefaultAvatarIconFileNameAtIndex(size_t index);
81 // Gets the full path of the high res avatar icon at |index|.
82 base::FilePath GetPathOfHighResAvatarAtIndex(size_t index);
84 // Returns a URL for the default avatar icon with specified index.
85 std::string GetDefaultAvatarIconUrl(size_t index);
87 // Checks if |index| is a valid avatar icon index
88 bool IsDefaultAvatarIconIndex(size_t index);
90 // 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 bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index);
94 } // namespace profiles
96 #endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_