| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return; | 191 return; |
| 192 | 192 |
| 193 // TODO(estade): make this a glow effect instead: crbug.com/658783 | 193 // TODO(estade): make this a glow effect instead: crbug.com/658783 |
| 194 gfx::Rect focus_bounds = GetLocalBounds(); | 194 gfx::Rect focus_bounds = GetLocalBounds(); |
| 195 focus_bounds.Inset(gfx::Insets(1)); | 195 focus_bounds.Inset(gfx::Insets(1)); |
| 196 canvas->DrawSolidFocusRect( | 196 canvas->DrawSolidFocusRect( |
| 197 gfx::RectF(focus_bounds), | 197 gfx::RectF(focus_bounds), |
| 198 SkColorSetA(GetNativeTheme()->GetSystemColor( | 198 SkColorSetA(GetNativeTheme()->GetSystemColor( |
| 199 ui::NativeTheme::kColorId_FocusedBorderColor), | 199 ui::NativeTheme::kColorId_FocusedBorderColor), |
| 200 0x99), | 200 0x99), |
| 201 2.f); | 201 2); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void Slider::OnSliderDragStarted() { | 204 void Slider::OnSliderDragStarted() { |
| 205 SetHighlighted(true); | 205 SetHighlighted(true); |
| 206 if (listener_) | 206 if (listener_) |
| 207 listener_->SliderDragStarted(this); | 207 listener_->SliderDragStarted(this); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void Slider::OnSliderDragEnded() { | 210 void Slider::OnSliderDragEnded() { |
| 211 SetHighlighted(false); | 211 SetHighlighted(false); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 event->SetHandled(); | 343 event->SetHandled(); |
| 344 if (event->details().touch_points() <= 1) | 344 if (event->details().touch_points() <= 1) |
| 345 OnSliderDragEnded(); | 345 OnSliderDragEnded(); |
| 346 break; | 346 break; |
| 347 default: | 347 default: |
| 348 break; | 348 break; |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace views | 352 } // namespace views |
| OLD | NEW |