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

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

Issue 895803003: [Profiles] Remove the NotificationService from the ProfileInfoCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: copy paste the right function Created 5 years, 10 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
Index: chrome/browser/profiles/avatar_menu.h
diff --git a/chrome/browser/profiles/avatar_menu.h b/chrome/browser/profiles/avatar_menu.h
index 5b08acfee797618386d282a7b8c2b019c46ea9ec..a2ab430a60c066cf3b7ad63ed8be07bf1a0ce406 100644
--- a/chrome/browser/profiles/avatar_menu.h
+++ b/chrome/browser/profiles/avatar_menu.h
@@ -12,10 +12,9 @@
#include "base/compiler_specific.h"
#include "base/scoped_observer.h"
#include "base/strings/string16.h"
+#include "chrome/browser/profiles/profile_info_cache_observer.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/ui/host_desktop.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/image/image.h"
@@ -41,7 +40,7 @@ class AvatarMenu :
#if defined(ENABLE_SUPERVISED_USERS)
public SupervisedUserServiceObserver,
#endif
- public content::NotificationObserver {
+ public ProfileInfoCacheObserver {
public:
// Represents an item in the menu.
struct Item {
@@ -147,17 +146,28 @@ class AvatarMenu :
// Returns true if the edit profile link should be shown.
bool ShouldShowEditProfileLink() const;
- // content::NotificationObserver:
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
-
private:
+ // ProfileInfoCacheObserver:
+ void OnProfileAdded(const base::FilePath& profile_path) override;
+ void OnProfileWasRemoved(const base::FilePath& profile_path,
+ const base::string16& profile_name) override;
+ void OnProfileNameChanged(const base::FilePath& profile_path,
+ const base::string16& old_profile_name) override;
+ void OnProfileUserNameChanged(const base::FilePath& profile_path) override;
+ void OnProfileAvatarChanged(const base::FilePath& profile_path) override;
+ void OnProfileHighResAvatarLoaded(
+ const base::FilePath& profile_path) override;
+ void OnProfileSigninRequiredChanged(
+ const base::FilePath& profile_path) override;
+
#if defined(ENABLE_SUPERVISED_USERS)
// SupervisedUserServiceObserver:
void OnCustodianInfoChanged() override;
#endif
+ // Rebuilds the menu and notifies any observers that an update occured.
+ void Update();
+
// The model that provides the list of menu items.
scoped_ptr<ProfileList> profile_list_;
@@ -179,9 +189,6 @@ class AvatarMenu :
// Browser in which this avatar menu resides. Weak.
Browser* browser_;
- // Listens for notifications from the ProfileInfoCache.
- content::NotificationRegistrar registrar_;
-
DISALLOW_COPY_AND_ASSIGN(AvatarMenu);
};

Powered by Google App Engine
This is Rietveld 408576698