| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
| 23 | 23 |
| 24 #if defined(ENABLE_SUPERVISED_USERS) | 24 #if defined(ENABLE_SUPERVISED_USERS) |
| 25 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" | 25 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 class AvatarMenuActions; | 28 class AvatarMenuActions; |
| 29 class AvatarMenuObserver; | 29 class AvatarMenuObserver; |
| 30 class Browser; | 30 class Browser; |
| 31 class Profile; | 31 class Profile; |
| 32 class ProfileAttributesStorage; |
| 32 class ProfileInfoInterface; | 33 class ProfileInfoInterface; |
| 33 class ProfileList; | 34 class ProfileList; |
| 34 class SupervisedUserService; | 35 class SupervisedUserService; |
| 35 | 36 |
| 36 // This class represents the menu-like interface used to select profiles, | 37 // This class represents the menu-like interface used to select profiles, |
| 37 // such as the bubble that appears when the avatar icon is clicked in the | 38 // such as the bubble that appears when the avatar icon is clicked in the |
| 38 // browser window frame. This class will notify its observer when the backend | 39 // browser window frame. This class will notify its observer when the backend |
| 39 // data changes, and the view for this model should forward actions | 40 // data changes, and the view for this model should forward actions |
| 40 // back to it in response to user events. | 41 // back to it in response to user events. |
| 41 class AvatarMenu : | 42 class AvatarMenu : |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 84 |
| 84 // The index in the |profile_cache| for this profile. | 85 // The index in the |profile_cache| for this profile. |
| 85 size_t profile_index; | 86 size_t profile_index; |
| 86 | 87 |
| 87 // The path of this profile. | 88 // The path of this profile. |
| 88 base::FilePath profile_path; | 89 base::FilePath profile_path; |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 // Constructor. |observer| can be NULL. |browser| can be NULL and a new one | 92 // Constructor. |observer| can be NULL. |browser| can be NULL and a new one |
| 92 // will be created if an action requires it. | 93 // will be created if an action requires it. |
| 93 AvatarMenu(ProfileInfoInterface* profile_cache, | 94 AvatarMenu(ProfileAttributesStorage* /*profile_storage*/, |
| 94 AvatarMenuObserver* observer, | 95 AvatarMenuObserver* observer, |
| 95 Browser* browser); | 96 Browser* browser); |
| 96 ~AvatarMenu() override; | 97 ~AvatarMenu() override; |
| 97 | 98 |
| 98 // True if avatar menu should be displayed. | 99 // True if avatar menu should be displayed. |
| 99 static bool ShouldShowAvatarMenu(); | 100 static bool ShouldShowAvatarMenu(); |
| 100 | 101 |
| 101 // Sets |image| to the avatar corresponding to the profile at |profile_path| | 102 // Sets |image| to the avatar corresponding to the profile at |profile_path| |
| 102 // and sets |is_rectangle| to true unless |image| is a built-in profile | 103 // and sets |is_rectangle| to true unless |image| is a built-in profile |
| 103 // avatar. For built-in profile avatars, returns the non-high res version. | 104 // avatar. For built-in profile avatars, returns the non-high res version. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // The observer of this model, which is notified of changes. Weak. | 191 // The observer of this model, which is notified of changes. Weak. |
| 191 AvatarMenuObserver* observer_; | 192 AvatarMenuObserver* observer_; |
| 192 | 193 |
| 193 // Browser in which this avatar menu resides. Weak. | 194 // Browser in which this avatar menu resides. Weak. |
| 194 Browser* browser_; | 195 Browser* browser_; |
| 195 | 196 |
| 196 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); | 197 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); |
| 197 }; | 198 }; |
| 198 | 199 |
| 199 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ | 200 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ |
| OLD | NEW |