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

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: 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 e6d6974c9a62a173e924d8a4635e09de7af5d8d5..a97c68ded9a850aa612a05f8d52cd937015ba330 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) -
@@ -732,7 +732,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.
@@ -742,12 +742,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