| 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" | 5 #include "ui/views/animation/test/test_ink_drop_host.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/gfx/geometry/size.h" | 8 #include "ui/gfx/geometry/size.h" |
| 9 #include "ui/views/animation/ink_drop_highlight.h" | 9 #include "ui/views/animation/ink_drop_highlight.h" |
| 10 #include "ui/views/animation/square_ink_drop_ripple.h" | 10 #include "ui/views/animation/square_ink_drop_ripple.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(TestInkDropRipple); | 48 DISALLOW_COPY_AND_ASSIGN(TestInkDropRipple); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // Test specific subclass of InkDropHighlight that returns a test api from | 51 // Test specific subclass of InkDropHighlight that returns a test api from |
| 52 // GetTestApi(). | 52 // GetTestApi(). |
| 53 class TestInkDropHighlight : public InkDropHighlight { | 53 class TestInkDropHighlight : public InkDropHighlight { |
| 54 public: | 54 public: |
| 55 TestInkDropHighlight(const gfx::Size& size, | 55 TestInkDropHighlight(const gfx::Size& size, |
| 56 int corner_radius, | 56 int corner_radius, |
| 57 const gfx::Point& center_point, | 57 const gfx::PointF& center_point, |
| 58 SkColor color) | 58 SkColor color) |
| 59 : InkDropHighlight(size, corner_radius, center_point, color) {} | 59 : InkDropHighlight(size, corner_radius, center_point, color) {} |
| 60 | 60 |
| 61 ~TestInkDropHighlight() override {} | 61 ~TestInkDropHighlight() override {} |
| 62 | 62 |
| 63 test::InkDropHighlightTestApi* GetTestApi() override { | 63 test::InkDropHighlightTestApi* GetTestApi() override { |
| 64 if (!test_api_) | 64 if (!test_api_) |
| 65 test_api_.reset(new test::InkDropHighlightTestApi(this)); | 65 test_api_.reset(new test::InkDropHighlightTestApi(this)); |
| 66 return test_api_.get(); | 66 return test_api_.get(); |
| 67 } | 67 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 95 size, 5, size, 5, gfx::Point(), SK_ColorBLACK, 0.175f)); | 95 size, 5, size, 5, gfx::Point(), SK_ColorBLACK, 0.175f)); |
| 96 if (disable_timers_for_test_) | 96 if (disable_timers_for_test_) |
| 97 ripple->GetTestApi()->SetDisableAnimationTimers(true); | 97 ripple->GetTestApi()->SetDisableAnimationTimers(true); |
| 98 return ripple; | 98 return ripple; |
| 99 } | 99 } |
| 100 | 100 |
| 101 std::unique_ptr<InkDropHighlight> TestInkDropHost::CreateInkDropHighlight() | 101 std::unique_ptr<InkDropHighlight> TestInkDropHost::CreateInkDropHighlight() |
| 102 const { | 102 const { |
| 103 std::unique_ptr<InkDropHighlight> highlight; | 103 std::unique_ptr<InkDropHighlight> highlight; |
| 104 if (should_show_highlight_) { | 104 if (should_show_highlight_) { |
| 105 highlight.reset(new TestInkDropHighlight(gfx::Size(10, 10), 4, gfx::Point(), | 105 highlight.reset(new TestInkDropHighlight(gfx::Size(10, 10), 4, |
| 106 SK_ColorBLACK)); | 106 gfx::PointF(), SK_ColorBLACK)); |
| 107 if (disable_timers_for_test_) | 107 if (disable_timers_for_test_) |
| 108 highlight->GetTestApi()->SetDisableAnimationTimers(true); | 108 highlight->GetTestApi()->SetDisableAnimationTimers(true); |
| 109 } | 109 } |
| 110 return highlight; | 110 return highlight; |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace views | 113 } // namespace views |
| OLD | NEW |