| 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/glow_hover_controller.h" | 5 #include "ui/views/controls/glow_hover_controller.h" |
| 6 | 6 |
| 7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
| 8 | 8 |
| 9 namespace views { | 9 namespace views { |
| 10 | 10 |
| 11 // Amount to scale the opacity. | 11 // Amount to scale the opacity. |
| 12 static const double kTrackOpacityScale = 0.5; | 12 static const double kTrackOpacityScale = 0.25; |
| 13 static const double kHighlightOpacityScale = 1.0; | 13 static const double kHighlightOpacityScale = 1.0; |
| 14 | 14 |
| 15 // How long the hover state takes. | 15 // How long the hover state takes. |
| 16 static const int kTrackHoverDurationMs = 400; | 16 static const int kTrackHoverDurationMs = 400; |
| 17 | 17 |
| 18 GlowHoverController::GlowHoverController(views::View* view) | 18 GlowHoverController::GlowHoverController(views::View* view) |
| 19 : view_(view), | 19 : view_(view), |
| 20 animation_(this), | 20 animation_(this), |
| 21 opacity_scale_(kTrackOpacityScale) { | 21 opacity_scale_(kTrackOpacityScale) { |
| 22 animation_.set_delegate(this); | 22 animation_.set_delegate(this); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 void GlowHoverController::AnimationEnded(const gfx::Animation* animation) { | 80 void GlowHoverController::AnimationEnded(const gfx::Animation* animation) { |
| 81 view_->SchedulePaint(); | 81 view_->SchedulePaint(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void GlowHoverController::AnimationProgressed(const gfx::Animation* animation) { | 84 void GlowHoverController::AnimationProgressed(const gfx::Animation* animation) { |
| 85 view_->SchedulePaint(); | 85 view_->SchedulePaint(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace views | 88 } // namespace views |
| OLD | NEW |