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..ee7c3656d18f0989e9cf512b72b906e40b93b400 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,8 @@ 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)) { |
+ if (hit_test == HTCAPTION && GetProfileSwitcherButton() && |
+ ConvertedHitTest(this, GetProfileSwitcherButton(), point)) { |
Peter Kasting
2017/04/26 02:09:53
Nit: Use a temp to capture the return value of Cam
emx
2017/04/27 16:30:58
Done.
|
return HTCLIENT; |
} |
#endif |
@@ -305,7 +306,7 @@ void BrowserNonClientFrameViewMus::Layout() { |
LayoutIncognitoButton(); |
#if defined(FRAME_AVATAR_BUTTON) |
- if (profile_switcher_.view()) |
+ if (GetProfileSwitcherButton()) |
LayoutProfileSwitcher(); |
#endif |
@@ -408,9 +409,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 +445,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 |
} |