Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc |
| diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc |
| index dda56b6306c4eae65ebec0825591d52b2fe301f9..4112d59d1de3397558f3413d48afc8c7a7c2b2b2 100644 |
| --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc |
| +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc |
| @@ -408,11 +408,10 @@ void BrowserNonClientFrameViewAsh::UpdateProfileIcons() { |
| // BrowserNonClientFrameViewAsh, private: |
| int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { |
| - const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON)); |
| - const int avatar_right = profile_indicator_icon() |
| - ? (insets.left() + GetIncognitoAvatarIcon().width()) |
| - : 0; |
| - return avatar_right + insets.right(); |
| + const int pad = GetLayoutConstant(AVATAR_ICON_PADDING); |
|
Peter Kasting
2016/11/22 22:12:08
Nit: "avoid abbreviation" ( http://google.github.i
Evan Stade
2016/11/29 03:01:45
Pad is actually a synonym of padding (and much old
Peter Kasting
2016/11/29 03:38:28
Do we use it very much elsewhere in views? I cert
Evan Stade
2016/11/30 00:39:22
I can see both sides. Padding is much more common,
|
| + const int avatar_right = |
| + profile_indicator_icon() ? (pad + GetIncognitoAvatarIcon().width()) : 0; |
| + return avatar_right + pad; |
| } |
| int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { |
| @@ -449,9 +448,9 @@ void BrowserNonClientFrameViewAsh::LayoutProfileIndicatorIcon() { |
| #endif |
| const gfx::ImageSkia incognito_icon = GetIncognitoAvatarIcon(); |
| - const gfx::Insets avatar_insets = GetLayoutInsets(AVATAR_ICON); |
| - const int avatar_bottom = GetTopInset(false) + |
| - browser_view()->GetTabStripHeight() - avatar_insets.bottom(); |
| + const int pad = GetLayoutConstant(AVATAR_ICON_PADDING); |
| + const int avatar_bottom = |
| + GetTopInset(false) + browser_view()->GetTabStripHeight() - pad; |
| int avatar_y = avatar_bottom - incognito_icon.height(); |
| // Hide the incognito icon in immersive fullscreen when the tab light bar is |
| @@ -459,8 +458,8 @@ void BrowserNonClientFrameViewAsh::LayoutProfileIndicatorIcon() { |
| // recognizable. |
| const bool avatar_visible = !UseImmersiveLightbarHeaderStyle(); |
| const int avatar_height = avatar_visible ? (avatar_bottom - avatar_y) : 0; |
| - profile_indicator_icon()->SetBounds(avatar_insets.left(), avatar_y, |
| - incognito_icon.width(), avatar_height); |
| + profile_indicator_icon()->SetBounds(pad, avatar_y, incognito_icon.width(), |
| + avatar_height); |
| profile_indicator_icon()->SetVisible(avatar_visible); |
| } |