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

Unified Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.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/opaque_browser_frame_view_layout.cc
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
index ef5b86c985340e5345a53baff93265c8acd10f4c..36ed8cc08c272fe1e76b9f185a4963b8b033fb19 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
@@ -107,7 +107,7 @@ void OpaqueBrowserFrameViewLayout::SetButtonOrdering(
gfx::Rect OpaqueBrowserFrameViewLayout::GetBoundsForTabStrip(
const gfx::Size& tabstrip_preferred_size,
int available_width) const {
- int x = leading_button_start_ + GetLayoutInsets(AVATAR_ICON).right();
+ int x = leading_button_start_ + GetLayoutConstant(AVATAR_ICON_PADDING);
available_width -= x + NewTabCaptionSpacing() + trailing_button_start_;
return gfx::Rect(x, GetTabStripInsetsTop(false), std::max(0, available_width),
tabstrip_preferred_size.height());
@@ -369,19 +369,19 @@ void OpaqueBrowserFrameViewLayout::LayoutIncognitoIcon(views::View* host) {
trailing_button_start_ = std::max(trailing_button_start_, min_button_width);
if (incognito_icon_) {
- const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON));
+ const int pad = GetLayoutConstant(AVATAR_ICON_PADDING);
const gfx::Size size(delegate_->GetIncognitoAvatarIcon().size());
- const int incognito_width = insets.left() + size.width();
+ const int incognito_width = pad + size.width();
int x;
if (ShouldIncognitoIconBeOnRight()) {
trailing_button_start_ += incognito_width;
x = host->width() - trailing_button_start_;
} else {
- x = leading_button_start_ + insets.left();
+ x = leading_button_start_ + pad;
leading_button_start_ += incognito_width;
}
- const int bottom = GetTabStripInsetsTop(false) +
- delegate_->GetTabStripHeight() - insets.bottom();
+ const int bottom =
+ GetTabStripInsetsTop(false) + delegate_->GetTabStripHeight() - pad;
incognito_icon_->SetBounds(x, bottom - size.height(), size.width(),
size.height());
}

Powered by Google App Engine
This is Rietveld 408576698