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

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

Issue 1545863002: Compute the correct height above the tabstrip when dragging tabs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 99b804179e95f6b799f31577b89dc624f6bb4b6e..7778f84893e5c9bddb5cb7f64aa6d062ea4fe46f 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -119,6 +119,9 @@ const int kPinnedToNonPinnedOffset = 2;
const int kPinnedToNonPinnedOffset = 3;
#endif
+// The vertical offset of the tab strip button.
+const int kNewTabButtonVerticalOffset = 7;
+
// Returns the size of the new tab button, not including any bounds extension to
// enlarge the clickable area.
gfx::Size GetNewTabButtonSize() {
@@ -445,7 +448,7 @@ bool NewTabButton::GetHitTestMask(gfx::Path* mask) const {
if (ui::MaterialDesignController::IsModeMaterial()) {
SkPath border;
const float scale = GetWidget()->GetCompositor()->device_scale_factor();
- GetBorderPath(TabStrip::kNewTabButtonVerticalOffset * scale, scale,
+ GetBorderPath(kNewTabButtonVerticalOffset * scale, scale,
tab_strip_->SizeTabButtonToTopOfTabStrip(), &border);
mask->addPath(border, SkMatrix::MakeScale(1 / scale));
} else if (tab_strip_->SizeTabButtonToTopOfTabStrip()) {
@@ -457,7 +460,7 @@ bool NewTabButton::GetHitTestMask(gfx::Path* mask) const {
mask->addRect(RectToSkRect(button_bounds));
} else {
SkScalar w = SkIntToScalar(width());
- SkScalar v_offset = SkIntToScalar(TabStrip::kNewTabButtonVerticalOffset);
+ SkScalar v_offset = SkIntToScalar(kNewTabButtonVerticalOffset);
// These values are defined by the shape of the new tab image. Should that
// image ever change, these values will need to be updated. They're so
@@ -568,8 +571,7 @@ void NewTabButton::PaintFill(bool pressed,
// no flip.
x += size.width();
}
- canvas->TileImageInt(*background, x,
- TabStrip::kNewTabButtonVerticalOffset + offset_y,
+ canvas->TileImageInt(*background, x, kNewTabButtonVerticalOffset + offset_y,
x_scale, 1.0f, 0, 0, size.width(), size.height());
// For non-MD, adjust the alpha of the fill to match that of inactive tabs
@@ -655,9 +657,6 @@ void TabStrip::RemoveTabDelegate::AnimationCanceled(
///////////////////////////////////////////////////////////////////////////////
// TabStrip, public:
-// static
-const int TabStrip::kNewTabButtonVerticalOffset = 7;
-
TabStrip::TabStrip(TabStripController* controller)
: controller_(controller),
newtab_button_(NULL),
« 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