1 // Copyright 2013 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.
5 #include "cc/input/pinch_zoom_scrollbar_painter.h"
7 #include "third_party/skia/include/core/SkCanvas.h"
8 #include "ui/gfx/rect.h"
12 PinchZoomScrollbarPainter::~PinchZoomScrollbarPainter() {}
14 void PinchZoomScrollbarPainter::PaintScrollbarBackground(
19 void PinchZoomScrollbarPainter::PaintTrackBackground(
24 void PinchZoomScrollbarPainter::PaintBackTrackPart(
29 void PinchZoomScrollbarPainter::PaintForwardTrackPart(
34 void PinchZoomScrollbarPainter::PaintBackButtonStart(
39 void PinchZoomScrollbarPainter::PaintBackButtonEnd(
44 void PinchZoomScrollbarPainter::PaintForwardButtonStart(
49 void PinchZoomScrollbarPainter::PaintForwardButtonEnd(
54 void PinchZoomScrollbarPainter::PaintTickmarks(
59 void PinchZoomScrollbarPainter::PaintThumb(
61 gfx::Rect thumb_rect
) {
62 canvas
->clear(SkColorSetARGB(0, 0, 0, 0));
65 // TODO(wjmaclean): currently the pinch-zoom overlay scrollbars are
66 // drawn as grey, but need to check this with UX design.
67 paint
.setColor(SkColorSetARGB(128, 32, 32, 32));
69 SkScalar corner_radius
= 2;
70 SkRect rect
= SkRect::MakeXYWH(border
, border
,
71 thumb_rect
.width() - 2 * border
,
72 thumb_rect
.height() - 2 * border
);
73 canvas
->drawRoundRect(rect
, corner_radius
, corner_radius
, paint
);