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 "ui/views/controls/scrollbar/overlay_scroll_bar.h" | 5 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
9 #include "third_party/skia/include/core/SkXfermode.h" | 9 #include "third_party/skia/include/core/SkXfermode.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 case ui::ET_SCROLL_FLING_START: | 132 case ui::ET_SCROLL_FLING_START: |
133 case ui::ET_GESTURE_END: | 133 case ui::ET_GESTURE_END: |
134 animation_.Hide(); | 134 animation_.Hide(); |
135 break; | 135 break; |
136 default: | 136 default: |
137 break; | 137 break; |
138 } | 138 } |
139 BaseScrollBar::OnGestureEvent(event); | 139 BaseScrollBar::OnGestureEvent(event); |
140 } | 140 } |
141 | 141 |
142 gfx::Size OverlayScrollBar::GetPreferredSize() const { | |
143 return gfx::Size(); | |
144 } | |
145 | |
146 void OverlayScrollBar::Layout() { | 142 void OverlayScrollBar::Layout() { |
147 gfx::Rect thumb_bounds = GetTrackBounds(); | 143 gfx::Rect thumb_bounds = GetTrackBounds(); |
148 BaseScrollBarThumb* thumb = GetThumb(); | 144 BaseScrollBarThumb* thumb = GetThumb(); |
149 if (IsHorizontal()) { | 145 if (IsHorizontal()) { |
150 thumb_bounds.set_x(thumb->x()); | 146 thumb_bounds.set_x(thumb->x()); |
151 thumb_bounds.set_width(thumb->width()); | 147 thumb_bounds.set_width(thumb->width()); |
152 } else { | 148 } else { |
153 thumb_bounds.set_y(thumb->y()); | 149 thumb_bounds.set_y(thumb->y()); |
154 thumb_bounds.set_height(thumb->height()); | 150 thumb_bounds.set_height(thumb->height()); |
155 } | 151 } |
156 thumb->SetBoundsRect(thumb_bounds); | 152 thumb->SetBoundsRect(thumb_bounds); |
157 } | 153 } |
158 | 154 |
159 void OverlayScrollBar::OnPaint(gfx::Canvas* canvas) { | |
160 } | |
161 | |
162 } // namespace views | 155 } // namespace views |
OLD | NEW |