Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2419)

Unified Diff: chrome/browser/profiles/avatar_menu.h

Issue 597783003: Update the AvatarMenu when a supervised user's custodian info changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ScopedObserver Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/avatar_menu.cc » ('j') | chrome/browser/profiles/avatar_menu.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/avatar_menu.h
diff --git a/chrome/browser/profiles/avatar_menu.h b/chrome/browser/profiles/avatar_menu.h
index f319a32cd8f750094d2c5829b0ca49fcd2c2c44d..73ba069b55091be78f2afaf1aa13981ffb27ac6f 100644
--- a/chrome/browser/profiles/avatar_menu.h
+++ b/chrome/browser/profiles/avatar_menu.h
@@ -19,19 +19,32 @@
#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/image/image.h"
+#if defined(ENABLE_MANAGED_USERS)
+#include "base/scoped_observer.h"
Bernhard Bauer 2014/09/25 16:11:19 For sake of simplicity, I would include this uncon
Marc Treib 2014/09/25 16:17:17 Done.
+#include "chrome/browser/supervised_user/supervised_user_service_observer.h"
+#endif
+
+class AvatarMenuActions;
class AvatarMenuObserver;
class Browser;
class Profile;
class ProfileInfoInterface;
class ProfileList;
-class AvatarMenuActions;
+
+#if defined(ENABLE_MANAGED_USERS)
+class SupervisedUserService;
Bernhard Bauer 2014/09/25 16:11:19 Same here, forward-declare this unconditionally. I
Marc Treib 2014/09/25 16:17:16 Done.
+#endif
// This class represents the menu-like interface used to select profiles,
// such as the bubble that appears when the avatar icon is clicked in the
// browser window frame. This class will notify its observer when the backend
// data changes, and the view for this model should forward actions
// back to it in response to user events.
-class AvatarMenu : public content::NotificationObserver {
+class AvatarMenu :
+#if defined(ENABLE_MANAGED_USERS)
+ public SupervisedUserServiceObserver,
+#endif
+ public content::NotificationObserver {
public:
// Represents an item in the menu.
struct Item {
@@ -142,12 +155,23 @@ class AvatarMenu : public content::NotificationObserver {
const content::NotificationDetails& details) OVERRIDE;
private:
+#if defined(ENABLE_MANAGED_USERS)
+ // SupervisedUserServiceObserver:
+ virtual void OnCustodianInfoChanged() OVERRIDE;
+#endif
+
// The model that provides the list of menu items.
scoped_ptr<ProfileList> profile_list_;
// The controller for avatar menu actions.
scoped_ptr<AvatarMenuActions> menu_actions_;
+#if defined(ENABLE_MANAGED_USERS)
+ // Observes changes to a supervised user's custodian info.
+ ScopedObserver<SupervisedUserService, SupervisedUserServiceObserver>
+ supervised_user_observer_;
Bernhard Bauer 2014/09/25 16:11:19 Indent two more spaces.
Marc Treib 2014/09/25 16:17:17 Done.
+#endif
+
// The cache that provides the profile information. Weak.
ProfileInfoInterface* profile_info_;
« no previous file with comments | « no previous file | chrome/browser/profiles/avatar_menu.cc » ('j') | chrome/browser/profiles/avatar_menu.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698