| Index: chrome/browser/ui/cocoa/profiles/avatar_base_controller.h
|
| diff --git a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.h b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.h
|
| index 115cb2f43c869c64fd9f8bdeaec86d958743db18..af151567292a4a4100596ec8677103588226b846 100644
|
| --- a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.h
|
| +++ b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.h
|
| @@ -10,13 +10,16 @@
|
| #include <memory>
|
|
|
| #import "base/mac/scoped_nsobject.h"
|
| +#include "chrome/browser/profiles/profile_attributes_storage.h"
|
| +#include "chrome/browser/ui/avatar_button_error_controller.h"
|
| +#include "chrome/browser/ui/avatar_button_error_controller_delegate.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h"
|
| #include "components/signin/core/browser/signin_header_helper.h"
|
|
|
| @class BaseBubbleController;
|
| class Browser;
|
| -class ProfileAttributesUpdateObserver;
|
| +class ProfileUpdateObserver;
|
|
|
| // This view controller manages the button that sits in the top of the
|
| // window frame when using multi-profiles, and shows information about the
|
| @@ -28,12 +31,13 @@ class ProfileAttributesUpdateObserver;
|
| // The avatar button. Child classes are responsible for implementing it.
|
| base::scoped_nsobject<NSButton> button_;
|
|
|
| + // Observer that listens for updates to the ProfileAttributesStorage as well
|
| + // as AvatarButtonErrorController.
|
| + std::unique_ptr<ProfileUpdateObserver> profileObserver_;
|
| +
|
| @private
|
| // The menu controller, if the menu is open.
|
| BaseBubbleController* menuController_;
|
| -
|
| - // Observer that listens for updates to the ProfileAttributesStorage.
|
| - std::unique_ptr<ProfileAttributesUpdateObserver> profileAttributesObserver_;
|
| }
|
|
|
| // The avatar button view.
|
| @@ -56,4 +60,33 @@ class ProfileAttributesUpdateObserver;
|
| - (BOOL)isCtrlPressed;
|
| @end
|
|
|
| +class ProfileUpdateObserver : public ProfileAttributesStorage::Observer,
|
| + public AvatarButtonErrorControllerDelegate {
|
| + public:
|
| + ProfileUpdateObserver(Profile* profile,
|
| + AvatarBaseController* avatarController);
|
| + ~ProfileUpdateObserver() override;
|
| +
|
| + // ProfileAttributesStorage::Observer:
|
| + 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 OnProfileSupervisedUserIdChanged(
|
| + const base::FilePath& profile_path) override;
|
| +
|
| + // AvatarButtonErrorControllerDelegate:
|
| + void OnAvatarErrorChanged() override;
|
| +
|
| + bool HasAvatarError();
|
| +
|
| + private:
|
| + AvatarButtonErrorController errorController_;
|
| + Profile* profile_;
|
| + AvatarBaseController* avatarController_; // Weak; owns this.
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ProfileUpdateObserver);
|
| +};
|
| +
|
| #endif // CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_
|
|
|