Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc

Issue 2523783002: Top Chrome MD cleanup - get rid of most of GetLayoutInsets. (Closed)
Patch Set: fix typo Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4cda1801f1a7b8b01fa93cc729d9891c295a612c..fdc0a8736c6e961993b83dc4322bf732afe248df 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
@@ -371,11 +371,11 @@ void BrowserNonClientFrameViewMus::TabStripDeleted(TabStrip* tab_strip) {
}
int BrowserNonClientFrameViewMus::GetTabStripLeftInset() const {
- const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON));
+ const int pad = GetLayoutConstant(AVATAR_ICON_PADDING);
const int avatar_right = profile_indicator_icon()
- ? (insets.left() + GetIncognitoAvatarIcon().width())
+ ? (pad + GetIncognitoAvatarIcon().width())
: 0;
- return avatar_right + insets.right() + frame_values().normal_insets.left();
+ return avatar_right + pad + frame_values().normal_insets.left();
}
int BrowserNonClientFrameViewMus::GetTabStripRightInset() const {
@@ -424,9 +424,9 @@ void BrowserNonClientFrameViewMus::LayoutIncognitoButton() {
DCHECK(browser_view()->IsTabStripVisible());
#endif
gfx::ImageSkia incognito_icon = GetIncognitoAvatarIcon();
- gfx::Insets avatar_insets = GetLayoutInsets(AVATAR_ICON);
- int avatar_bottom = GetTopInset(false) + browser_view()->GetTabStripHeight() -
- avatar_insets.bottom();
+ const int pad = GetLayoutConstant(AVATAR_ICON_PADDING);
+ 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
@@ -435,8 +435,7 @@ void BrowserNonClientFrameViewMus::LayoutIncognitoButton() {
bool avatar_visible = !UseImmersiveLightbarHeaderStyle();
int avatar_height = avatar_visible ? incognito_icon.height() : 0;
- gfx::Rect avatar_bounds(avatar_insets.left(), avatar_y,
- incognito_icon.width(), avatar_height);
+ gfx::Rect avatar_bounds(pad, avatar_y, incognito_icon.width(), avatar_height);
profile_indicator_icon()->SetBoundsRect(avatar_bounds);
profile_indicator_icon()->SetVisible(avatar_visible);
}

Powered by Google App Engine
This is Rietveld 408576698