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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_ 6 #define CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
7 7
8 #include "chrome/browser/profiles/avatar_menu.h" 8 #include "chrome/browser/profiles/profile_info_cache_observer.h"
9 #include "chrome/browser/profiles/avatar_menu_observer.h"
10 #include "ui/views/controls/button/menu_button.h" 9 #include "ui/views/controls/button/menu_button.h"
11 10
11 class Browser;
12
12 // Avatar button that displays the active profile's name in the caption area. 13 // Avatar button that displays the active profile's name in the caption area.
13 class NewAvatarButton : public views::MenuButton, 14 class NewAvatarButton : public views::MenuButton,
14 public AvatarMenuObserver { 15 public ProfileInfoCacheObserver {
15 public: 16 public:
16 // Different button styles that can be applied. 17 // Different button styles that can be applied.
17 enum AvatarButtonStyle { 18 enum AvatarButtonStyle {
18 THEMED_BUTTON, // Used in a themed browser window. 19 THEMED_BUTTON, // Used in a themed browser window.
19 NATIVE_BUTTON, // Used in a native aero or metro window. 20 NATIVE_BUTTON, // Used in a native aero or metro window.
20 }; 21 };
21 22
22 NewAvatarButton(views::ButtonListener* listener, 23 NewAvatarButton(views::ButtonListener* listener,
23 const base::string16& profile_name, 24 const base::string16& profile_name,
24 AvatarButtonStyle button_style, 25 AvatarButtonStyle button_style,
25 Browser* browser); 26 Browser* browser);
26 virtual ~NewAvatarButton(); 27 virtual ~NewAvatarButton();
27 28
28 // views::View: 29 // views::View:
29 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 30 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
30 31
31 private: 32 private:
32 friend class NewAvatarMenuButtonTest; 33 friend class NewAvatarMenuButtonTest;
33 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut); 34 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut);
34 35
35 // AvatarMenuObserver: 36 // ProfileInfoCacheObserver:
36 virtual void OnAvatarMenuChanged(AvatarMenu* avatar_menu) OVERRIDE; 37 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE;
37 38
sky 2014/02/20 22:14:08 nit: no newline between overrides for same class (
noms (inactive) 2014/02/24 22:35:06 Done.
38 scoped_ptr<AvatarMenu> avatar_menu_; 39 virtual void OnProfileWasRemoved(
40 const base::FilePath& profile_path,
41 const base::string16& profile_name) OVERRIDE;
42
43 virtual void OnProfileNameChanged(
44 const base::FilePath& profile_path,
45 const base::string16& old_profile_name) OVERRIDE;
46
47 // Called when the profile info cache has changed, which means we might
48 // have to re-display the profile name.
49 void UpdateAvatarButtonAndRelayoutParent();
50
39 Browser* browser_; 51 Browser* browser_;
40 52
41 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton); 53 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton);
42 }; 54 };
43 55
44 #endif // CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_ 56 #endif // CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698