| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/animation/test/test_ink_drop_delegate.h" | 5 #include "ui/views/animation/test/test_ink_drop_delegate.h" |
| 6 | 6 |
| 7 namespace views { | 7 namespace views { |
| 8 namespace test { | 8 namespace test { |
| 9 | 9 |
| 10 TestInkDropDelegate::TestInkDropDelegate() | 10 TestInkDropDelegate::TestInkDropDelegate() {} |
| 11 : state_(InkDropState::HIDDEN), is_hovered_(false) {} | |
| 12 | 11 |
| 13 TestInkDropDelegate::~TestInkDropDelegate() {} | 12 TestInkDropDelegate::~TestInkDropDelegate() {} |
| 14 | 13 |
| 15 void TestInkDropDelegate::OnAction(InkDropState state) { | 14 void TestInkDropDelegate::OnAction(InkDropState state) { |
| 16 state_ = state; | 15 ink_drop_.AnimateToState(state); |
| 17 } | 16 } |
| 18 | 17 |
| 19 void TestInkDropDelegate::SnapToActivated() { | 18 void TestInkDropDelegate::SnapToActivated() { |
| 20 state_ = InkDropState::ACTIVATED; | 19 ink_drop_.SnapToActivated(); |
| 21 } | 20 } |
| 22 | 21 |
| 23 void TestInkDropDelegate::SetHovered(bool is_hovered) { | 22 void TestInkDropDelegate::SetHovered(bool is_hovered) { |
| 24 is_hovered_ = is_hovered; | 23 ink_drop_.SetHovered(true); |
| 25 } | 24 } |
| 26 | 25 |
| 27 InkDropState TestInkDropDelegate::GetTargetInkDropState() const { | 26 InkDropState TestInkDropDelegate::GetTargetInkDropState() const { |
| 28 return state_; | 27 return ink_drop_.GetTargetInkDropState(); |
| 29 } | 28 } |
| 30 | 29 |
| 31 InkDrop* TestInkDropDelegate::GetInkDrop() { | 30 InkDrop* TestInkDropDelegate::GetInkDrop() { |
| 32 return nullptr; | 31 return &ink_drop_; |
| 33 } | 32 } |
| 34 | 33 |
| 35 } // namespace test | 34 } // namespace test |
| 36 } // namespace views | 35 } // namespace views |
| OLD | NEW |