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

Unified Diff: chrome/browser/ui/views/profiles/new_avatar_button.h

Issue 1139943002: Revert of Refactor the avatar button/icon class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/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 f10876dd9aa18092eb15272fdea58e64ceb53608..4c09eed9b41f86cbc301f5f284d1b67b40ec62e9 100644
--- a/chrome/browser/ui/views/profiles/new_avatar_button.h
+++ b/chrome/browser/ui/views/profiles/new_avatar_button.h
@@ -5,15 +5,15 @@
#ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_
#define CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_
-#include "chrome/browser/ui/views/profiles/avatar_base_button.h"
+#include "chrome/browser/profiles/profile_info_cache_observer.h"
#include "components/signin/core/browser/signin_error_controller.h"
#include "ui/views/controls/button/label_button.h"
class Browser;
// Avatar button that displays the active profile's name in the caption area.
-class NewAvatarButton : public AvatarBaseButton,
- public views::LabelButton,
+class NewAvatarButton : public views::LabelButton,
+ public ProfileInfoCacheObserver,
public SigninErrorController::Observer {
public:
// Different button styles that can be applied.
@@ -31,15 +31,26 @@
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
- protected:
- // AvatarBaseButton:
- void Update() override;
-
private:
friend class ProfileChooserViewExtensionsTest;
+ // 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 OnProfileSupervisedUserIdChanged(
+ const base::FilePath& profile_path) override;
+
// SigninErrorController::Observer:
void OnErrorChanged() override;
+
+ // Called when the profile info cache has changed, which means we might
+ // have to update the icon/text of the button.
+ void Update();
+
+ Browser* browser_;
// Whether the signed in profile has an authentication error. Used to display
// an error icon next to the button text.
« no previous file with comments | « chrome/browser/ui/views/profiles/avatar_menu_button.cc ('k') | chrome/browser/ui/views/profiles/new_avatar_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698