OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/slider.h" | 5 #include "ui/views/controls/slider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 kFullColor); | 211 kFullColor); |
212 | 212 |
213 button_cx = x + kLineThickness / 2; | 213 button_cx = x + kLineThickness / 2; |
214 button_cy = content.y() + empty + kButtonRadius; | 214 button_cy = content.y() + empty + kButtonRadius; |
215 | 215 |
216 SkPaint paint; | 216 SkPaint paint; |
217 paint.setStyle(SkPaint::kFill_Style); | 217 paint.setStyle(SkPaint::kFill_Style); |
218 paint.setAntiAlias(true); | 218 paint.setAntiAlias(true); |
219 paint.setColor(kButtonColor); | 219 paint.setColor(kButtonColor); |
220 canvas->sk_canvas()->drawCircle(button_cx, button_cy, kButtonRadius, paint); | 220 canvas->sk_canvas()->drawCircle(button_cx, button_cy, kButtonRadius, paint); |
221 View::OnPaint(canvas); | |
222 } | 221 } |
| 222 View::OnPaint(canvas); |
223 } | 223 } |
224 | 224 |
225 bool Slider::OnMousePressed(const views::MouseEvent& event) { | 225 bool Slider::OnMousePressed(const views::MouseEvent& event) { |
226 if (listener_) | 226 if (listener_) |
227 listener_->SliderDragStarted(this); | 227 listener_->SliderDragStarted(this); |
228 MoveButtonTo(event.location()); | 228 MoveButtonTo(event.location()); |
229 return true; | 229 return true; |
230 } | 230 } |
231 | 231 |
232 bool Slider::OnMouseDragged(const views::MouseEvent& event) { | 232 bool Slider::OnMouseDragged(const views::MouseEvent& event) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 void Slider::OnPaintFocusBorder(gfx::Canvas* canvas) { | 286 void Slider::OnPaintFocusBorder(gfx::Canvas* canvas) { |
287 if (!focus_border_color_) { | 287 if (!focus_border_color_) { |
288 View::OnPaintFocusBorder(canvas); | 288 View::OnPaintFocusBorder(canvas); |
289 } else if (HasFocus() && (focusable() || IsAccessibilityFocusable())) { | 289 } else if (HasFocus() && (focusable() || IsAccessibilityFocusable())) { |
290 canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3), | 290 canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3), |
291 focus_border_color_); | 291 focus_border_color_); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 } // namespace views | 295 } // namespace views |
OLD | NEW |