Chromium Code Reviews| 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.h" | |
| 5 #include "ui/views/animation/test/test_ink_drop_delegate.h" | 6 #include "ui/views/animation/test/test_ink_drop_delegate.h" |
| 6 | 7 |
| 7 namespace views { | 8 namespace views { |
| 8 namespace test { | 9 namespace test { |
| 9 | 10 |
| 10 TestInkDropDelegate::TestInkDropDelegate() | 11 TestInkDropDelegate::TestInkDropDelegate() |
| 11 : state_(InkDropState::HIDDEN), is_hovered_(false) {} | 12 : state_(InkDropState::HIDDEN), is_hovered_(false) {} |
| 12 | 13 |
| 13 TestInkDropDelegate::~TestInkDropDelegate() {} | 14 TestInkDropDelegate::~TestInkDropDelegate() {} |
| 14 | 15 |
| 15 void TestInkDropDelegate::OnAction(InkDropState state) { | 16 void TestInkDropDelegate::OnAction(InkDropState state) { |
| 16 state_ = state; | 17 state_ = state; |
| 17 } | 18 } |
| 18 | 19 |
| 19 void TestInkDropDelegate::SnapToActivated() { | 20 void TestInkDropDelegate::SnapToActivated() { |
| 20 state_ = InkDropState::ACTIVATED; | 21 state_ = InkDropState::ACTIVATED; |
| 21 } | 22 } |
| 22 | 23 |
| 23 void TestInkDropDelegate::SetHovered(bool is_hovered) { | 24 void TestInkDropDelegate::SetHovered(bool is_hovered) { |
| 24 is_hovered_ = is_hovered; | 25 is_hovered_ = is_hovered; |
| 25 } | 26 } |
| 26 | 27 |
| 27 InkDropState TestInkDropDelegate::GetTargetInkDropState() const { | 28 InkDropState TestInkDropDelegate::GetTargetInkDropState() const { |
| 28 return state_; | 29 return state_; |
| 29 } | 30 } |
| 30 | 31 |
| 31 InkDrop* TestInkDropDelegate::GetInkDrop() { | 32 InkDrop* TestInkDropDelegate::GetInkDrop() { |
| 32 return nullptr; | 33 if (!ink_drop_.get()) |
| 34 ink_drop_ = base::WrapUnique(new TestInkDrop()); | |
|
sky
2016/06/02 02:01:40
nit: ink_drop.reset(new TestInkDrop); is shorter a
| |
| 35 return ink_drop_.get(); | |
| 33 } | 36 } |
| 34 | 37 |
| 35 } // namespace test | 38 } // namespace test |
| 36 } // namespace views | 39 } // namespace views |
| OLD | NEW |