OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "cc/pinch_zoom_scrollbar_painter.h" |
| 6 |
| 7 #include "third_party/skia/include/core/SkCanvas.h" |
| 8 #include "ui/gfx/rect.h" |
| 9 |
| 10 namespace cc { |
| 11 |
| 12 PinchZoomScrollbarPainter::~PinchZoomScrollbarPainter() {} |
| 13 |
| 14 void PinchZoomScrollbarPainter::PaintScrollbarBackground( |
| 15 SkCanvas*, |
| 16 const gfx::Rect&) { |
| 17 } |
| 18 |
| 19 void PinchZoomScrollbarPainter::PaintTrackBackground( |
| 20 SkCanvas*, |
| 21 const gfx::Rect&) { |
| 22 } |
| 23 |
| 24 void PinchZoomScrollbarPainter::PaintBackTrackPart( |
| 25 SkCanvas*, |
| 26 const gfx::Rect&) { |
| 27 } |
| 28 |
| 29 void PinchZoomScrollbarPainter::PaintForwardTrackPart( |
| 30 SkCanvas*, |
| 31 const gfx::Rect&) { |
| 32 } |
| 33 |
| 34 void PinchZoomScrollbarPainter::PaintBackButtonStart( |
| 35 SkCanvas*, |
| 36 const gfx::Rect&) { |
| 37 } |
| 38 |
| 39 void PinchZoomScrollbarPainter::PaintBackButtonEnd( |
| 40 SkCanvas*, |
| 41 const gfx::Rect&) { |
| 42 } |
| 43 |
| 44 void PinchZoomScrollbarPainter::PaintForwardButtonStart( |
| 45 SkCanvas*, |
| 46 const gfx::Rect&) { |
| 47 } |
| 48 |
| 49 void PinchZoomScrollbarPainter::PaintForwardButtonEnd( |
| 50 SkCanvas*, |
| 51 const gfx::Rect&) { |
| 52 } |
| 53 |
| 54 void PinchZoomScrollbarPainter::PaintTickmarks( |
| 55 SkCanvas*, |
| 56 const gfx::Rect&) { |
| 57 } |
| 58 |
| 59 void PinchZoomScrollbarPainter::PaintThumb( |
| 60 SkCanvas* canvas, |
| 61 const gfx::Rect& thumb_rect) { |
| 62 canvas->clear(SkColorSetARGB(0, 0, 0, 0)); |
| 63 SkPaint paint; |
| 64 |
| 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)); |
| 68 SkScalar border = 2; |
| 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); |
| 74 } |
| 75 |
| 76 } // namespace cc |
OLD | NEW |