Index: chrome/browser/ui/views/frame/browser_non_client_frame_view.h |
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h |
index 81344a8881e5fca1e35c343cf204aee2b06dc002..1a74195b85fc587fdf8b73449b7886fae4afc633 100644 |
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h |
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h |
@@ -9,7 +9,7 @@ |
#include "ui/views/window/non_client_view.h" |
#if defined(FRAME_AVATAR_BUTTON) |
-#include "chrome/browser/ui/views/profiles/new_avatar_button.h" |
+#include "chrome/browser/ui/views/frame/avatar_button_manager.h" |
#endif |
#if defined(ENABLE_SUPERVISED_USERS) |
@@ -27,10 +27,14 @@ class BrowserNonClientFrameView : public views::NonClientFrameView, |
BrowserNonClientFrameView(BrowserFrame* frame, BrowserView* browser_view); |
~BrowserNonClientFrameView() override; |
+ BrowserView* browser_view() const { return browser_view_; } |
+ BrowserFrame* frame() const { return frame_; } |
AvatarMenuButton* avatar_button() const { return avatar_button_; } |
#if defined(FRAME_AVATAR_BUTTON) |
- NewAvatarButton* new_avatar_button() const { return new_avatar_button_; } |
+ views::View* new_avatar_button() const { |
+ return profile_switcher_.view(); |
+ } |
#endif |
#if defined(ENABLE_SUPERVISED_USERS) |
@@ -74,9 +78,6 @@ class BrowserNonClientFrameView : public views::NonClientFrameView, |
void ChildPreferredSizeChanged(View* child) override; |
protected: |
- BrowserView* browser_view() const { return browser_view_; } |
- BrowserFrame* frame() const { return frame_; } |
- |
// Whether the frame should be painted with theming. |
// By default, tabbed browser windows are themed but popup and app windows are |
// not. |
@@ -103,10 +104,8 @@ class BrowserNonClientFrameView : public views::NonClientFrameView, |
#if defined(FRAME_AVATAR_BUTTON) |
// Updates the title of the avatar button displayed in the caption area. |
- // The button uses |style| to match the browser window style and notifies |
- // |listener| when it is clicked. |
- void UpdateNewAvatarButton(views::ButtonListener* listener, |
- const NewAvatarButton::AvatarButtonStyle style); |
+ // The button uses |style| to match the browser window style. |
+ void UpdateNewAvatarButton(const AvatarButtonStyle style); |
#endif |
private: |
@@ -130,9 +129,9 @@ class BrowserNonClientFrameView : public views::NonClientFrameView, |
#endif |
#if defined(FRAME_AVATAR_BUTTON) |
- // Menu button that displays the name of the active or guest profile. |
- // May be null and will not be displayed for off the record profiles. |
- NewAvatarButton* new_avatar_button_; |
+ // Wrapper around the in-frame avatar switcher. |
+ // TODO(tapted): Move this component down into the subclasses that need it. |
+ AvatarButtonManager profile_switcher_; |
#endif |
// Menu button that displays the incognito icon. May be null for some frame |