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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_
8 #include "chrome/browser/profiles/avatar_menu.h"
9 #include "chrome/browser/profiles/avatar_menu_observer.h"
10 #include "ui/views/controls/button/menu_button.h"
12 // Avatar button that displays the active profile's name in the caption area.
13 class NewAvatarButton
: public views::MenuButton
,
14 public AvatarMenuObserver
{
16 // Different button styles that can be applied.
17 enum AvatarButtonStyle
{
18 THEMED_BUTTON
, // Used in a themed browser window.
19 NATIVE_BUTTON
, // Used in a native aero or metro window.
22 NewAvatarButton(views::ButtonListener
* listener
,
23 const base::string16
& profile_name
,
24 AvatarButtonStyle button_style
,
26 virtual ~NewAvatarButton();
29 virtual void OnPaint(gfx::Canvas
* canvas
) OVERRIDE
;
32 friend class NewAvatarMenuButtonTest
;
33 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest
, SignOut
);
35 // AvatarMenuObserver:
36 virtual void OnAvatarMenuChanged(AvatarMenu
* avatar_menu
) OVERRIDE
;
38 scoped_ptr
<AvatarMenu
> avatar_menu_
;
41 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton
);
44 #endif // CHROME_BROWSER_UI_VIEWS_NEW_AVATAR_BUTTON_H_