Chromium Code Reviews| Index: chrome/browser/ui/views/profiles/new_avatar_button.h |
| diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.h b/chrome/browser/ui/views/profiles/new_avatar_button.h |
| index 662d58dd5fd99acf1eb9484636163f2553a7e100..66111e2034df1a46ed8ba2718d781ca76e28d16d 100644 |
| --- a/chrome/browser/ui/views/profiles/new_avatar_button.h |
| +++ b/chrome/browser/ui/views/profiles/new_avatar_button.h |
| @@ -7,9 +7,9 @@ |
| #include "base/macros.h" |
| #include "chrome/browser/profiles/profile_attributes_storage.h" |
| +#include "chrome/browser/signin/avatar_signin_error_controller.h" |
| +#include "chrome/browser/sync/avatar_sync_error_controller.h" |
| #include "chrome/browser/ui/views/profiles/avatar_button_style.h" |
| -#include "components/signin/core/browser/signin_error_controller.h" |
| -#include "components/sync_driver/sync_error_controller.h" |
| #include "ui/views/controls/button/label_button.h" |
| class AvatarButtonDelegate; |
| @@ -19,34 +19,26 @@ class Profile; |
| class NewAvatarButton : public views::LabelButton, |
| public ProfileAttributesStorage::Observer { |
| public: |
| - class SigninErrorObserver : public SigninErrorController::Observer { |
| + class AvatarSigninErrorObserver : public AvatarSigninErrorController { |
|
sky
2016/07/27 18:17:30
Does this and the next really need to be in the pu
Jane
2016/07/27 20:17:49
You're right, no need to be in the public section.
|
| public: |
| - SigninErrorObserver(NewAvatarButton* parent_button, Profile* profile); |
| - ~SigninErrorObserver() override; |
| - |
| - private: |
| - // SigninErrorController::Observer: |
| + AvatarSigninErrorObserver(Profile* profile, NewAvatarButton* parent_button); |
| void OnErrorChanged() override; |
| + private: |
| NewAvatarButton* parent_button_; |
| - Profile* profile_; |
| - DISALLOW_COPY_AND_ASSIGN(SigninErrorObserver); |
| + DISALLOW_COPY_AND_ASSIGN(AvatarSigninErrorObserver); |
| }; |
| - class SyncErrorObserver : public SyncErrorController::Observer { |
| + class AvatarSyncErrorObserver : public AvatarSyncErrorController { |
| public: |
| - SyncErrorObserver(NewAvatarButton* parent_button, Profile* profile); |
| - ~SyncErrorObserver() override; |
| - |
| - private: |
| - // SyncErrorController::Observer: |
| + AvatarSyncErrorObserver(Profile* profile, NewAvatarButton* parent_button); |
| void OnErrorChanged() override; |
| + private: |
| NewAvatarButton* parent_button_; |
| - Profile* profile_; |
| - DISALLOW_COPY_AND_ASSIGN(SyncErrorObserver); |
| + DISALLOW_COPY_AND_ASSIGN(AvatarSyncErrorObserver); |
| }; |
| NewAvatarButton(AvatarButtonDelegate* delegate, |
| @@ -61,7 +53,9 @@ class NewAvatarButton : public views::LabelButton, |
| // Views |
| void OnGestureEvent(ui::GestureEvent* event) override; |
| - void OnErrorChanged(); |
| + // Called when the profile info cache or signin/sync error has changed, which |
| + // means we might have to update the icon/text of the button. |
| + void Update(); |
| private: |
| friend class ProfileChooserViewExtensionsTest; |
| @@ -75,20 +69,12 @@ class NewAvatarButton : public views::LabelButton, |
| void OnProfileSupervisedUserIdChanged( |
| const base::FilePath& profile_path) override; |
| - // Called when the profile info cache has changed, which means we might |
| - // have to update the icon/text of the button. |
| - void Update(); |
| - |
| - SigninErrorObserver signin_error_observer_; |
| - SyncErrorObserver sync_error_observer_; |
| + AvatarSigninErrorObserver signin_error_observer_; |
| + AvatarSyncErrorObserver sync_error_observer_; |
| AvatarButtonDelegate* delegate_; |
| Profile* profile_; |
| - // Whether the signed in profile has any authentication error or sync error. |
| - // Used to display an error icon next to the button text. |
| - bool has_error_; |
| - |
| // The icon displayed instead of the profile name in the local profile case. |
| // Different assets are used depending on the OS version. |
| gfx::ImageSkia generic_avatar_; |