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

Side by Side Diff: chrome/browser/ui/tabs/tab_resources.cc

Issue 7657009: Revert 96674 - Gtk: Make click target of tabs match their appearance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/tabs/tab_resources.h ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/tabs/tab_resources.h"
6
7 #include "base/logging.h"
8 #include "ui/gfx/path.h"
9
10 namespace {
11
12 // Hit mask constants.
13 const SkScalar kTabCapWidth = 15;
14 const SkScalar kTabTopCurveWidth = 4;
15 const SkScalar kTabBottomCurveWidth = 3;
16
17 } // namespace
18
19 // static
20 void TabResources::GetHitTestMask(int width, int height, gfx::Path* path) {
21 DCHECK(path);
22
23 SkScalar h = SkIntToScalar(height);
24 SkScalar w = SkIntToScalar(width);
25
26 path->moveTo(0, h);
27
28 // Left end cap.
29 path->lineTo(kTabBottomCurveWidth, h - kTabBottomCurveWidth);
30 path->lineTo(kTabCapWidth - kTabTopCurveWidth, kTabTopCurveWidth);
31 path->lineTo(kTabCapWidth, 0);
32
33 // Connect to the right cap.
34 path->lineTo(w - kTabCapWidth, 0);
35
36 // Right end cap.
37 path->lineTo(w - kTabCapWidth + kTabTopCurveWidth, kTabTopCurveWidth);
38 path->lineTo(w - kTabBottomCurveWidth, h - kTabBottomCurveWidth);
39 path->lineTo(w, h);
40
41 // Close out the path.
42 path->lineTo(0, h);
43 path->close();
44 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_resources.h ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698