| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" | 5 #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/WebKit/public/platform/WebScrollbar.h" | 8 #include "third_party/WebKit/public/platform/WebScrollbar.h" |
| 9 #include "third_party/WebKit/public/platform/WebScrollbarThemeGeometry.h" | 9 #include "third_party/WebKit/public/platform/WebScrollbarThemeGeometry.h" |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (scrollbar_->orientation() == WebScrollbar::Horizontal) | 56 if (scrollbar_->orientation() == WebScrollbar::Horizontal) |
| 57 return thumb_rect.width(); | 57 return thumb_rect.width(); |
| 58 return thumb_rect.height(); | 58 return thumb_rect.height(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 gfx::Rect ScrollbarImpl::TrackRect() const { | 61 gfx::Rect ScrollbarImpl::TrackRect() const { |
| 62 return geometry_->trackRect(scrollbar_.get()); | 62 return geometry_->trackRect(scrollbar_.get()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void ScrollbarImpl::PaintPart( | 65 void ScrollbarImpl::PaintPart( |
| 66 SkCanvas* canvas, cc::ScrollbarPart part, gfx::Rect content_rect) { | 66 SkCanvas* canvas, cc::ScrollbarPart part, |
| 67 const gfx::Rect& content_rect) { |
| 67 if (part == cc::THUMB) { | 68 if (part == cc::THUMB) { |
| 68 painter_.paintThumb(canvas, content_rect); | 69 painter_.paintThumb(canvas, content_rect); |
| 69 return; | 70 return; |
| 70 } | 71 } |
| 71 | 72 |
| 72 // The following is a simplification of ScrollbarThemeComposite::paint. | 73 // The following is a simplification of ScrollbarThemeComposite::paint. |
| 73 painter_.paintScrollbarBackground(canvas, content_rect); | 74 painter_.paintScrollbarBackground(canvas, content_rect); |
| 74 | 75 |
| 75 if (geometry_->hasButtons(scrollbar_.get())) { | 76 if (geometry_->hasButtons(scrollbar_.get())) { |
| 76 gfx::Rect back_button_start_paint_rect = | 77 gfx::Rect back_button_start_paint_rect = |
| (...skipping 20 matching lines...) Expand all Loading... |
| 97 bool thumb_present = geometry_->hasThumb(scrollbar_.get()); | 98 bool thumb_present = geometry_->hasThumb(scrollbar_.get()); |
| 98 if (thumb_present) { | 99 if (thumb_present) { |
| 99 painter_.paintForwardTrackPart(canvas, track_paint_rect); | 100 painter_.paintForwardTrackPart(canvas, track_paint_rect); |
| 100 painter_.paintBackTrackPart(canvas, track_paint_rect); | 101 painter_.paintBackTrackPart(canvas, track_paint_rect); |
| 101 } | 102 } |
| 102 | 103 |
| 103 painter_.paintTickmarks(canvas, track_paint_rect); | 104 painter_.paintTickmarks(canvas, track_paint_rect); |
| 104 } | 105 } |
| 105 | 106 |
| 106 } // namespace webkit | 107 } // namespace webkit |
| OLD | NEW |