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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1402453002: Parametrize some more constants that will be changing in MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Created 5 years, 2 months 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 3bf454de2dc09e695926fe145a66c4780feac385..3207c24b01011cef6ef9171c62fee9c56856ce16 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -120,16 +120,15 @@ const int kStackedTabLeftClip = 20;
const int kStackedTabRightClip = 20;
#if defined(OS_MACOSX)
-const int kNewTabButtonHorizontalOffset = -8;
const int kPinnedToNonPinnedOffset = 2;
#else
-const int kNewTabButtonHorizontalOffset = -11;
const int kPinnedToNonPinnedOffset = 3;
#endif
// Returns the width needed for the new tab button (and padding).
int GetNewTabButtonWidth() {
- return TabStrip::kNewTabButtonAssetWidth + kNewTabButtonHorizontalOffset;
+ return GetLayoutConstant(NEW_TAB_BUTTON_WIDTH) -
+ GetLayoutConstant(TABSTRIP_NEW_TAB_BUTTON_OVERLAP);
}
// Animation delegate used for any automatic tab movement. Hides the tab if it
@@ -536,7 +535,6 @@ void TabStrip::RemoveTabDelegate::AnimationCanceled(
// static
const int TabStrip::kNewTabButtonVerticalOffset = 7;
-const int TabStrip::kNewTabButtonAssetWidth = 34;
TabStrip::TabStrip(TabStripController* controller)
: controller_(controller),
@@ -1513,7 +1511,7 @@ void TabStrip::Init() {
// So we get enter/exit on children to switch stacked layout on and off.
set_notify_enter_exit_on_child(true);
newtab_button_bounds_.SetRect(
- 0, 0, kNewTabButtonAssetWidth,
+ 0, 0, GetLayoutConstant(NEW_TAB_BUTTON_WIDTH),
kNewTabButtonHeight + kNewTabButtonVerticalOffset);
newtab_button_ = new NewTabButton(this, this);
newtab_button_->SetTooltipText(
@@ -2317,8 +2315,8 @@ void TabStrip::GenerateIdealBounds() {
tabs_.set_ideal_bounds(i, tabs_bounds[i]);
}
- const int new_tab_x = tabs_.ideal_bounds(tabs_.view_size() - 1).right() +
- kNewTabButtonHorizontalOffset;
+ const int new_tab_x = tabs_.ideal_bounds(tabs_.view_size() - 1).right() -
+ GetLayoutConstant(TABSTRIP_NEW_TAB_BUTTON_OVERLAP);
newtab_button_bounds_.set_origin(gfx::Point(new_tab_x, 0));
}
@@ -2384,7 +2382,8 @@ void TabStrip::StartMouseInitiatedRemoveTabAnimation(int model_index) {
// the new tab button should stay where it is.
newtab_button_bounds_.set_x(std::min(
width() - newtab_button_bounds_.width(),
- ideal_bounds(tab_count() - 1).right() + kNewTabButtonHorizontalOffset));
+ ideal_bounds(tab_count() - 1).right() -
+ GetLayoutConstant(TABSTRIP_NEW_TAB_BUTTON_OVERLAP)));
PrepareForAnimation();
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698