Commit 9aae24b9 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Remove TabStrip::GetNewTabButtonWidth().

This is unnecessary, since the new tab button width doesn't change, and is
stored in |new_tab_button_bounds_|.  We can simply read that directly.

Bug: none
Change-Id: I7bc1305f3e366b07f78a79cfa3e2b4cf340c792f
Reviewed-on: https://chromium-review.googlesource.com/1132559Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574197}
parent 38d9d19a
......@@ -1184,7 +1184,7 @@ int TabStrip::GetBackgroundResourceId(bool* custom_image) const {
// the frame image. Furthermore, since the theme provider will create the
// incognito frame image from the normal frame image, in incognito mode we
// need to look for a custom incognito _or_ regular frame image.
const bool incognito = controller_->IsIncognito();
const bool incognito = IsIncognito();
const int id =
incognito ? IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND;
*custom_image = tp->HasCustomImage(id) ||
......@@ -1401,8 +1401,7 @@ gfx::Size TabStrip::CalculatePreferredSize() const {
largest_min_tab_width);
}
return gfx::Size(needed_tab_width + TabToFollowingNewTabButtonSpacing() +
GetNewTabButtonWidth(IsIncognito()) +
GetFrameGrabWidth(),
new_tab_button_bounds_.width() + GetFrameGrabWidth(),
GetLayoutConstant(TAB_HEIGHT));
}
......@@ -1585,10 +1584,6 @@ bool TabStrip::ShouldHighlightCloseButtonAfterRemove() {
return in_tab_close_;
}
int TabStrip::GetNewTabButtonWidth(bool is_incognito) const {
return GetLayoutSize(NEW_TAB_BUTTON, is_incognito).width();
}
int TabStrip::TabToFollowingNewTabButtonSpacing() const {
if (controller_->GetNewTabButtonPosition() != AFTER_TABS)
return 0;
......@@ -1755,7 +1750,7 @@ std::vector<gfx::Rect> TabStrip::CalculateBoundsForDraggedTabs(
int TabStrip::TabStartX() const {
return (controller_->GetNewTabButtonPosition() == LEADING)
? GetNewTabButtonWidth(IsIncognito())
? new_tab_button_bounds_.width()
: 0;
}
......@@ -1769,7 +1764,7 @@ int TabStrip::NewTabButtonIdealX() const {
if (position == LEADING)
return 0;
const int tab_area_width = width() - GetNewTabButtonWidth(IsIncognito());
const int tab_area_width = width() - new_tab_button_bounds_.width();
if (position == TRAILING)
return tab_area_width;
......@@ -2273,7 +2268,7 @@ int TabStrip::GenerateIdealBoundsForPinnedTabs(int* first_non_pinned_index) {
}
int TabStrip::GetTabAreaWidth() const {
return width() - GetFrameGrabWidth() - GetNewTabButtonWidth(IsIncognito()) -
return width() - GetFrameGrabWidth() - new_tab_button_bounds_.width() -
TabToFollowingNewTabButtonSpacing();
}
......
......@@ -339,9 +339,6 @@ class TabStrip : public views::View,
// Returns whether the close button should be highlighted after a remove.
bool ShouldHighlightCloseButtonAfterRemove();
// Returns the width needed for the new tab button (and padding).
int GetNewTabButtonWidth(bool is_incognito) const;
// If the new tab button position is AFTER_TABS, returns the spacing to use
// between the trailing edge of the tabs and the leading edge of the new tab
// button. For other button positions, returns 0.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment