OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AVATAR_MENU_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ |
6 #define CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ | 6 #define CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // Constructor. |observer| can be NULL. |browser| can be NULL and a new one | 85 // Constructor. |observer| can be NULL. |browser| can be NULL and a new one |
86 // will be created if an action requires it. | 86 // will be created if an action requires it. |
87 AvatarMenu(ProfileInfoInterface* profile_cache, | 87 AvatarMenu(ProfileInfoInterface* profile_cache, |
88 AvatarMenuObserver* observer, | 88 AvatarMenuObserver* observer, |
89 Browser* browser); | 89 Browser* browser); |
90 ~AvatarMenu() override; | 90 ~AvatarMenu() override; |
91 | 91 |
92 // True if avatar menu should be displayed. | 92 // True if avatar menu should be displayed. |
93 static bool ShouldShowAvatarMenu(); | 93 static bool ShouldShowAvatarMenu(); |
94 | 94 |
95 // Sets |image| to the image corresponding to the given profile, and | |
96 // sets |is_rectangle| to true unless |image| is a built-in profile avatar. | |
97 static void GetImageForMenuButton(Profile* profile, | |
98 gfx::Image* image, | |
99 bool* is_rectangle); | |
100 | |
101 // Compare items by name. | 95 // Compare items by name. |
102 static bool CompareItems(const Item* item1, const Item* item2); | 96 static bool CompareItems(const Item* item1, const Item* item2); |
103 | 97 |
104 // Opens a Browser with the specified profile in response to the user | 98 // Opens a Browser with the specified profile in response to the user |
105 // selecting an item. If |always_create| is true then a new window is created | 99 // selecting an item. If |always_create| is true then a new window is created |
106 // even if a window for that profile already exists. | 100 // even if a window for that profile already exists. |
107 void SwitchToProfile(size_t index, | 101 void SwitchToProfile(size_t index, |
108 bool always_create, | 102 bool always_create, |
109 ProfileMetrics::ProfileOpen metric); | 103 ProfileMetrics::ProfileOpen metric); |
110 | 104 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Browser in which this avatar menu resides. Weak. | 172 // Browser in which this avatar menu resides. Weak. |
179 Browser* browser_; | 173 Browser* browser_; |
180 | 174 |
181 // Listens for notifications from the ProfileInfoCache. | 175 // Listens for notifications from the ProfileInfoCache. |
182 content::NotificationRegistrar registrar_; | 176 content::NotificationRegistrar registrar_; |
183 | 177 |
184 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); | 178 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); |
185 }; | 179 }; |
186 | 180 |
187 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ | 181 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ |
OLD | NEW |