OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INFO_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_INFO_UTIL_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_INFO_UTIL_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_INFO_UTIL_H_ |
7 | 7 |
8 #include "ui/gfx/image/image.h" | 8 #include "ui/gfx/image/image.h" |
9 | 9 |
10 class ProfileInfoInterface; | |
11 | |
12 namespace ui { | |
13 struct AvatarMenuItemModel; | |
14 } | |
15 | |
16 namespace base{ | |
17 class FilePath; | |
18 } | |
19 | |
10 namespace profiles { | 20 namespace profiles { |
11 | 21 |
12 extern const int kAvatarIconWidth; | 22 extern const int kAvatarIconWidth; |
13 extern const int kAvatarIconHeight; | 23 extern const int kAvatarIconHeight; |
14 extern const int kAvatarIconBorder; | 24 extern const int kAvatarIconBorder; |
15 | 25 |
16 // Returns a version of |image| of a specific size and with a grey border. | 26 // Returns a version of |image| of a specific size and with a grey border. |
17 // Note that no checks are done on the width/height so make sure they're | 27 // Note that no checks are done on the width/height so make sure they're |
18 // reasonable values; in the range of 16-256 is probably best. | 28 // reasonable values; in the range of 16-256 is probably best. |
19 gfx::Image GetSizedAvatarIconWithBorder(const gfx::Image& image, | 29 gfx::Image GetSizedAvatarIconWithBorder(const gfx::Image& image, |
20 bool is_gaia_picture, | 30 bool is_gaia_picture, |
21 int width, int height); | 31 int width, int height); |
22 | 32 |
23 // Returns a version of |image| suitable for use in menus. | 33 // Returns a version of |image| suitable for use in menus. |
24 gfx::Image GetAvatarIconForMenu(const gfx::Image& image, | 34 gfx::Image GetAvatarIconForMenu(const gfx::Image& image, |
25 bool is_gaia_picture); | 35 bool is_gaia_picture); |
26 | 36 |
27 // Returns a version of |image| suitable for use in WebUI. | 37 // Returns a version of |image| suitable for use in WebUI. |
28 gfx::Image GetAvatarIconForWebUI(const gfx::Image& image, | 38 gfx::Image GetAvatarIconForWebUI(const gfx::Image& image, |
29 bool is_gaia_picture); | 39 bool is_gaia_picture); |
30 | 40 |
31 // Returns a version of |image| suitable for use in title bars. The returned | 41 // Returns a version of |image| suitable for use in title bars. The returned |
32 // image is scaled to fit |dst_width| and |dst_height|. | 42 // image is scaled to fit |dst_width| and |dst_height|. |
33 gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image, | 43 gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image, |
34 bool is_gaia_picture, | 44 bool is_gaia_picture, |
35 int dst_width, | 45 int dst_width, |
36 int dst_height); | 46 int dst_height); |
37 | 47 |
38 } | 48 // Populates |items| with AvatarMenuItemModels that are constructed from |
49 // profiles in the given |cache|. |active_profile_path| is optionally used to | |
50 // specify the active profile. | |
51 void PopulateAvatarMenuItemModels( | |
52 std::vector<ui::AvatarMenuItemModel*>& items, | |
koz (OOO until 15th September)
2013/08/02 01:51:16
Use a pointer here - we only use const references
calamity
2013/08/02 09:59:54
Done.
| |
53 const ProfileInfoInterface* cache, | |
54 const base::FilePath& active_profile_path); | |
55 | |
56 } // namespace profiles | |
39 | 57 |
40 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_UTIL_H_ | 58 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_UTIL_H_ |
OLD | NEW |