| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_host.h" |
| 6 |
| 7 #include "base/memory/ptr_util.h" |
| 5 #include "ui/gfx/geometry/size.h" | 8 #include "ui/gfx/geometry/size.h" |
| 6 #include "ui/views/animation/ink_drop_hover.h" | 9 #include "ui/views/animation/ink_drop_hover.h" |
| 7 #include "ui/views/animation/square_ink_drop_animation.h" | 10 #include "ui/views/animation/square_ink_drop_animation.h" |
| 8 #include "ui/views/animation/test/test_ink_drop_host.h" | |
| 9 | 11 |
| 10 namespace views { | 12 namespace views { |
| 11 | 13 |
| 12 TestInkDropHost::TestInkDropHost() | 14 TestInkDropHost::TestInkDropHost() |
| 13 : num_ink_drop_layers_(0), should_show_hover_(false) {} | 15 : num_ink_drop_layers_(0), should_show_hover_(false) {} |
| 14 | 16 |
| 15 TestInkDropHost::~TestInkDropHost() {} | 17 TestInkDropHost::~TestInkDropHost() {} |
| 16 | 18 |
| 17 void TestInkDropHost::AddInkDropLayer(ui::Layer* ink_drop_layer) { | 19 void TestInkDropHost::AddInkDropLayer(ui::Layer* ink_drop_layer) { |
| 18 ++num_ink_drop_layers_; | 20 ++num_ink_drop_layers_; |
| 19 } | 21 } |
| 20 | 22 |
| 21 void TestInkDropHost::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 23 void TestInkDropHost::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
| 22 --num_ink_drop_layers_; | 24 --num_ink_drop_layers_; |
| 23 } | 25 } |
| 24 | 26 |
| 25 scoped_ptr<InkDropAnimation> TestInkDropHost::CreateInkDropAnimation() const { | 27 std::unique_ptr<InkDropAnimation> TestInkDropHost::CreateInkDropAnimation() |
| 28 const { |
| 26 gfx::Size size(10, 10); | 29 gfx::Size size(10, 10); |
| 27 return make_scoped_ptr(new SquareInkDropAnimation( | 30 return base::WrapUnique(new SquareInkDropAnimation( |
| 28 size, 5, size, 5, gfx::Point(), SK_ColorBLACK)); | 31 size, 5, size, 5, gfx::Point(), SK_ColorBLACK)); |
| 29 } | 32 } |
| 30 | 33 |
| 31 scoped_ptr<InkDropHover> TestInkDropHost::CreateInkDropHover() const { | 34 std::unique_ptr<InkDropHover> TestInkDropHost::CreateInkDropHover() const { |
| 32 return should_show_hover_ | 35 return should_show_hover_ |
| 33 ? make_scoped_ptr(new InkDropHover(gfx::Size(10, 10), 4, | 36 ? base::WrapUnique(new InkDropHover(gfx::Size(10, 10), 4, |
| 34 gfx::Point(), SK_ColorBLACK)) | 37 gfx::Point(), SK_ColorBLACK)) |
| 35 : nullptr; | 38 : nullptr; |
| 36 } | 39 } |
| 37 | 40 |
| 38 } // namespace views | 41 } // namespace views |
| OLD | NEW |