Index: chrome/browser/ui/views/tabs/tab.cc |
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc |
index b675565aac39662ddb027e0c94af2c81b1d1e4b6..be385c32611c5d2ec581ae8211e96e9ce2d5f0d5 100644 |
--- a/chrome/browser/ui/views/tabs/tab.cc |
+++ b/chrome/browser/ui/views/tabs/tab.cc |
@@ -9,6 +9,7 @@ |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/defaults.h" |
#include "chrome/browser/themes/theme_service.h" |
+#include "chrome/browser/ui/tabs/tab_resources.h" |
#include "grit/generated_resources.h" |
#include "grit/theme_resources.h" |
#include "grit/theme_resources_standard.h" |
@@ -84,11 +85,6 @@ static const SkColor kMiniTitleChangeGradientColor1 = SK_ColorWHITE; |
static const SkColor kMiniTitleChangeGradientColor2 = |
SkColorSetARGB(0, 255, 255, 255); |
-// Hit mask constants. |
-static const SkScalar kTabCapWidth = 15; |
-static const SkScalar kTabTopCurveWidth = 4; |
-static const SkScalar kTabBottomCurveWidth = 3; |
- |
// static |
const char Tab::kViewClassName[] = "browser/tabs/Tab"; |
@@ -325,29 +321,7 @@ bool Tab::HasHitTestMask() const { |
} |
void Tab::GetHitTestMask(gfx::Path* path) const { |
- DCHECK(path); |
- |
- SkScalar h = SkIntToScalar(height()); |
- SkScalar w = SkIntToScalar(width()); |
- |
- path->moveTo(0, h); |
- |
- // Left end cap. |
- path->lineTo(kTabBottomCurveWidth, h - kTabBottomCurveWidth); |
- path->lineTo(kTabCapWidth - kTabTopCurveWidth, kTabTopCurveWidth); |
- path->lineTo(kTabCapWidth, 0); |
- |
- // Connect to the right cap. |
- path->lineTo(w - kTabCapWidth, 0); |
- |
- // Right end cap. |
- path->lineTo(w - kTabCapWidth + kTabTopCurveWidth, kTabTopCurveWidth); |
- path->lineTo(w - kTabBottomCurveWidth, h - kTabBottomCurveWidth); |
- path->lineTo(w, h); |
- |
- // Close out the path. |
- path->lineTo(0, h); |
- path->close(); |
+ TabResources::GetHitTestMask(width(), height(), path); |
} |
bool Tab::GetTooltipTextOrigin(const gfx::Point& p, gfx::Point* origin) { |