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

Side by Side Diff: chrome/browser/ui/views/new_avatar_button.h

Issue 229293002: [Win] Move profile related UI from ui/views/ to ui/views/profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
7
8 #include "chrome/browser/profiles/profile_info_cache_observer.h"
9 #include "ui/views/controls/button/menu_button.h"
10
11 class Browser;
12
13 // Avatar button that displays the active profile's name in the caption area.
14 class NewAvatarButton : public views::MenuButton,
15 public ProfileInfoCacheObserver {
16 public:
17 // Different button styles that can be applied.
18 enum AvatarButtonStyle {
19 THEMED_BUTTON, // Used in a themed browser window.
20 NATIVE_BUTTON, // Used in a native aero or metro window.
21 };
22
23 NewAvatarButton(views::ButtonListener* listener,
24 const base::string16& profile_name,
25 AvatarButtonStyle button_style,
26 Browser* browser);
27 virtual ~NewAvatarButton();
28
29 // views::View:
30 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
31
32 private:
33 friend class NewAvatarMenuButtonTest;
34 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut);
35
36 // ProfileInfoCacheObserver:
37 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE;
38 virtual void OnProfileWasRemoved(
39 const base::FilePath& profile_path,
40 const base::string16& profile_name) OVERRIDE;
41 virtual void OnProfileNameChanged(
42 const base::FilePath& profile_path,
43 const base::string16& old_profile_name) OVERRIDE;
44
45 // Called when the profile info cache has changed, which means we might
46 // have to re-display the profile name.
47 void UpdateAvatarButtonAndRelayoutParent();
48
49 Browser* browser_;
50
51 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton);
52 };
53
54 #endif // CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698