OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/views/animation/ink_drop.h" | |
6 #include "ui/views/animation/test/test_ink_drop_delegate.h" | |
7 | |
8 namespace views { | |
9 namespace test { | |
10 | |
11 class TestInkDrop : public InkDrop { | |
12 public: | |
13 TestInkDrop() : InkDrop() {} | |
14 ~TestInkDrop() override {} | |
15 | |
16 InkDropState GetTargetInkDropState() const override { | |
17 NOTREACHED(); | |
18 return InkDropState::HIDDEN; | |
19 } | |
20 | |
21 bool IsVisible() const override { | |
22 NOTREACHED(); | |
23 return false; | |
24 } | |
25 void AnimateToState(InkDropState ink_drop_state) override { NOTREACHED(); } | |
26 void SnapToActivated() override { NOTREACHED(); } | |
27 void SetHovered(bool is_hovered) override { NOTREACHED(); } | |
28 void SetFocused(bool is_focused) override {} | |
29 | |
30 private: | |
31 DISALLOW_COPY_AND_ASSIGN(TestInkDrop); | |
32 }; | |
33 | |
34 TestInkDropDelegate::TestInkDropDelegate() | |
35 : state_(InkDropState::HIDDEN), is_hovered_(false) {} | |
36 | |
37 TestInkDropDelegate::~TestInkDropDelegate() {} | |
38 | |
39 void TestInkDropDelegate::OnAction(InkDropState state) { | |
40 state_ = state; | |
41 } | |
42 | |
43 void TestInkDropDelegate::SnapToActivated() { | |
44 state_ = InkDropState::ACTIVATED; | |
45 } | |
46 | |
47 void TestInkDropDelegate::SetHovered(bool is_hovered) { | |
48 is_hovered_ = is_hovered; | |
49 } | |
50 | |
51 InkDropState TestInkDropDelegate::GetTargetInkDropState() const { | |
52 return state_; | |
53 } | |
54 | |
55 InkDrop* TestInkDropDelegate::GetInkDrop() { | |
56 if (!ink_drop_.get()) | |
57 ink_drop_.reset(new TestInkDrop); | |
58 return ink_drop_.get(); | |
59 } | |
60 | |
61 } // namespace test | |
62 } // namespace views | |
OLD | NEW |