| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 // The path of this profile. | 81 // The path of this profile. |
| 82 base::FilePath profile_path; | 82 base::FilePath profile_path; |
| 83 }; | 83 }; |
| 84 | 84 |
| 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 virtual ~AvatarMenu(); | 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 | 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. | 96 // sets |is_rectangle| to true unless |image| is a built-in profile avatar. |
| 97 static void GetImageForMenuButton(Profile* profile, | 97 static void GetImageForMenuButton(Profile* profile, |
| 98 gfx::Image* image, | 98 gfx::Image* image, |
| 99 bool* is_rectangle); | 99 bool* is_rectangle); |
| 100 | 100 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // last active browser changes, the menu will need to reference that browser. | 140 // last active browser changes, the menu will need to reference that browser. |
| 141 void ActiveBrowserChanged(Browser* browser); | 141 void ActiveBrowserChanged(Browser* browser); |
| 142 | 142 |
| 143 // Returns true if the add profile link should be shown. | 143 // Returns true if the add profile link should be shown. |
| 144 bool ShouldShowAddNewProfileLink() const; | 144 bool ShouldShowAddNewProfileLink() const; |
| 145 | 145 |
| 146 // Returns true if the edit profile link should be shown. | 146 // Returns true if the edit profile link should be shown. |
| 147 bool ShouldShowEditProfileLink() const; | 147 bool ShouldShowEditProfileLink() const; |
| 148 | 148 |
| 149 // content::NotificationObserver: | 149 // content::NotificationObserver: |
| 150 virtual void Observe(int type, | 150 void Observe(int type, |
| 151 const content::NotificationSource& source, | 151 const content::NotificationSource& source, |
| 152 const content::NotificationDetails& details) override; | 152 const content::NotificationDetails& details) override; |
| 153 | 153 |
| 154 private: | 154 private: |
| 155 #if defined(ENABLE_MANAGED_USERS) | 155 #if defined(ENABLE_MANAGED_USERS) |
| 156 // SupervisedUserServiceObserver: | 156 // SupervisedUserServiceObserver: |
| 157 virtual void OnCustodianInfoChanged() override; | 157 void OnCustodianInfoChanged() override; |
| 158 #endif | 158 #endif |
| 159 | 159 |
| 160 // The model that provides the list of menu items. | 160 // The model that provides the list of menu items. |
| 161 scoped_ptr<ProfileList> profile_list_; | 161 scoped_ptr<ProfileList> profile_list_; |
| 162 | 162 |
| 163 // The controller for avatar menu actions. | 163 // The controller for avatar menu actions. |
| 164 scoped_ptr<AvatarMenuActions> menu_actions_; | 164 scoped_ptr<AvatarMenuActions> menu_actions_; |
| 165 | 165 |
| 166 #if defined(ENABLE_MANAGED_USERS) | 166 #if defined(ENABLE_MANAGED_USERS) |
| 167 // Observes changes to a supervised user's custodian info. | 167 // Observes changes to a supervised user's custodian info. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 178 // Browser in which this avatar menu resides. Weak. | 178 // Browser in which this avatar menu resides. Weak. |
| 179 Browser* browser_; | 179 Browser* browser_; |
| 180 | 180 |
| 181 // Listens for notifications from the ProfileInfoCache. | 181 // Listens for notifications from the ProfileInfoCache. |
| 182 content::NotificationRegistrar registrar_; | 182 content::NotificationRegistrar registrar_; |
| 183 | 183 |
| 184 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); | 184 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ | 187 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ |
| OLD | NEW |