Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc |
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc |
index 273910bdf986cd5b93d0027232bcf135fd099324..0b1831888779687fb57220e408ab6563be441540 100644 |
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc |
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc |
@@ -170,9 +170,10 @@ void BrowserNonClientFrameViewMus::UpdateThrobber(bool running) { |
window_icon_->Update(); |
} |
-views::View* BrowserNonClientFrameViewMus::GetProfileSwitcherView() const { |
+views::MenuButton* BrowserNonClientFrameViewMus::GetProfileSwitcherButton() |
+ const { |
#if defined(FRAME_AVATAR_BUTTON) |
- return profile_switcher_.view(); |
+ return profile_switcher_.button(); |
#else |
return nullptr; |
#endif |
@@ -250,8 +251,9 @@ int BrowserNonClientFrameViewMus::NonClientHitTest(const gfx::Point& point) { |
int hit_test = HTCLIENT; |
#if defined(FRAME_AVATAR_BUTTON) |
- if (hit_test == HTCAPTION && profile_switcher_.view() && |
- ConvertedHitTest(this, profile_switcher_.view(), point)) { |
+ views::MenuButton* avatar_button = GetProfileSwitcherButton(); |
+ if (hit_test == HTCAPTION && avatar_button && |
+ ConvertedHitTest(this, avatar_button, point)) { |
return HTCLIENT; |
} |
#endif |
@@ -305,7 +307,7 @@ void BrowserNonClientFrameViewMus::Layout() { |
LayoutIncognitoButton(); |
#if defined(FRAME_AVATAR_BUTTON) |
- if (profile_switcher_.view()) |
+ if (GetProfileSwitcherButton()) |
LayoutProfileSwitcher(); |
#endif |
@@ -408,9 +410,9 @@ int BrowserNonClientFrameViewMus::GetTabStripRightInset() const { |
int right_inset = kTabstripRightSpacing + frame_right_insets; |
#if defined(FRAME_AVATAR_BUTTON) |
- if (profile_switcher_.view()) { |
+ if (GetProfileSwitcherButton()) { |
right_inset += kAvatarButtonOffset + |
- profile_switcher_.view()->GetPreferredSize().width(); |
+ GetProfileSwitcherButton()->GetPreferredSize().width(); |
} |
#endif |
@@ -444,10 +446,10 @@ void BrowserNonClientFrameViewMus::LayoutIncognitoButton() { |
void BrowserNonClientFrameViewMus::LayoutProfileSwitcher() { |
#if defined(FRAME_AVATAR_BUTTON) |
- gfx::Size button_size = profile_switcher_.view()->GetPreferredSize(); |
+ gfx::Size button_size = GetProfileSwitcherButton()->GetPreferredSize(); |
int button_x = width() - GetTabStripRightInset() + kAvatarButtonOffset; |
- profile_switcher_.view()->SetBounds(button_x, 0, button_size.width(), |
- button_size.height()); |
+ GetProfileSwitcherButton()->SetBounds(button_x, 0, button_size.width(), |
+ button_size.height()); |
#endif |
} |