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

Unified Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.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/glass_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index 9362e6133e066e7cbcaa000ef8787c73a2d61e0c..e8e14d3ed6558f49824a0c4620974b4a4fa91838 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -140,7 +140,7 @@ GlassBrowserFrameView::~GlassBrowserFrameView() {
gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip(
views::View* tabstrip) const {
const int x =
- incognito_bounds_.right() + GetLayoutInsets(AVATAR_ICON).right();
+ incognito_bounds_.right() + GetLayoutConstant(AVATAR_ICON_PADDING);
int end_x = width() - ClientBorderThickness(false);
if (!CaptionButtonsOnLeadingEdge()) {
end_x = std::min(MinimizeButtonX(), end_x) -
@@ -739,7 +739,7 @@ void GlassBrowserFrameView::LayoutProfileSwitcher() {
}
void GlassBrowserFrameView::LayoutIncognitoIcon() {
- const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON));
+ const int pad = GetLayoutConstant(AVATAR_ICON_PADDING);
const gfx::Size size(GetIncognitoAvatarIcon().size());
int x = ClientBorderThickness(false);
// In RTL, the icon needs to start after the caption buttons.
@@ -749,12 +749,11 @@ void GlassBrowserFrameView::LayoutIncognitoIcon() {
kProfileSwitcherButtonOffset)
: 0);
}
- const int bottom = GetTopInset(false) + browser_view()->GetTabStripHeight() -
- insets.bottom();
- incognito_bounds_.SetRect(x + (profile_indicator_icon() ? insets.left() : 0),
- bottom - size.height(),
- profile_indicator_icon() ? size.width() : 0,
- size.height());
+ const int bottom =
+ GetTopInset(false) + browser_view()->GetTabStripHeight() - pad;
+ incognito_bounds_.SetRect(
+ x + (profile_indicator_icon() ? pad : 0), bottom - size.height(),
+ profile_indicator_icon() ? size.width() : 0, size.height());
if (profile_indicator_icon())
profile_indicator_icon()->SetBoundsRect(incognito_bounds_);
}

Powered by Google App Engine
This is Rietveld 408576698