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

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

Issue 171523004: Stop using the old-style profile names when using --new-profile-management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: whitespace Created 6 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/ui/views/new_avatar_button.h
diff --git a/chrome/browser/ui/views/new_avatar_button.h b/chrome/browser/ui/views/new_avatar_button.h
index 2b9665f1c345a67659125ab4d39d10fa22af9f9c..3309eed87d0b8861030c8a15553601dea9350fda 100644
--- a/chrome/browser/ui/views/new_avatar_button.h
+++ b/chrome/browser/ui/views/new_avatar_button.h
@@ -5,13 +5,14 @@
#ifndef CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
#define CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
-#include "chrome/browser/profiles/avatar_menu.h"
-#include "chrome/browser/profiles/avatar_menu_observer.h"
+#include "chrome/browser/profiles/profile_info_cache_observer.h"
#include "ui/views/controls/button/menu_button.h"
+class Browser;
+
// Avatar button that displays the active profile's name in the caption area.
class NewAvatarButton : public views::MenuButton,
- public AvatarMenuObserver {
+ public ProfileInfoCacheObserver {
public:
// Different button styles that can be applied.
enum AvatarButtonStyle {
@@ -32,10 +33,21 @@ class NewAvatarButton : public views::MenuButton,
friend class NewAvatarMenuButtonTest;
FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut);
- // AvatarMenuObserver:
- virtual void OnAvatarMenuChanged(AvatarMenu* avatar_menu) OVERRIDE;
+ // ProfileInfoCacheObserver:
+ virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE;
+
sky 2014/02/20 22:14:08 nit: no newline between overrides for same class (
noms (inactive) 2014/02/24 22:35:06 Done.
+ virtual void OnProfileWasRemoved(
+ const base::FilePath& profile_path,
+ const base::string16& profile_name) OVERRIDE;
+
+ virtual void OnProfileNameChanged(
+ const base::FilePath& profile_path,
+ const base::string16& old_profile_name) OVERRIDE;
+
+ // Called when the profile info cache has changed, which means we might
+ // have to re-display the profile name.
+ void UpdateAvatarButtonAndRelayoutParent();
- scoped_ptr<AvatarMenu> avatar_menu_;
Browser* browser_;
DISALLOW_COPY_AND_ASSIGN(NewAvatarButton);

Powered by Google App Engine
This is Rietveld 408576698