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 #ifndef UI_VIEWS_ANIMATION_TEST_INK_DROP_HOST_VIEW_TEST_API_H_ | 5 #ifndef UI_VIEWS_ANIMATION_TEST_INK_DROP_HOST_VIEW_TEST_API_H_ |
6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_HOST_VIEW_TEST_API_H_ | 6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_HOST_VIEW_TEST_API_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "ui/views/animation/ink_drop.h" | 12 #include "ui/views/animation/ink_drop.h" |
13 #include "ui/views/animation/ink_drop_host_view.h" | 13 #include "ui/views/animation/ink_drop_host_view.h" |
14 | 14 |
15 namespace views { | 15 namespace views { |
16 namespace test { | 16 namespace test { |
17 | 17 |
18 // Test API to provide internal access to an InkDropHostView instance. | 18 // Test API to provide internal access to an InkDropHostView instance. |
19 class InkDropHostViewTestApi { | 19 class InkDropHostViewTestApi { |
20 public: | 20 public: |
21 explicit InkDropHostViewTestApi(InkDropHostView* host_view); | 21 explicit InkDropHostViewTestApi(InkDropHostView* host_view); |
22 ~InkDropHostViewTestApi(); | 22 ~InkDropHostViewTestApi(); |
23 | 23 |
24 void SetHasInkDrop(bool has_an_ink_drop); | 24 void SetHasInkDrop(bool has_an_ink_drop); |
25 | 25 |
| 26 void SetInkDrop(std::unique_ptr<InkDrop> ink_drop, |
| 27 bool handles_gesture_events); |
26 void SetInkDrop(std::unique_ptr<InkDrop> ink_drop); | 28 void SetInkDrop(std::unique_ptr<InkDrop> ink_drop); |
27 InkDrop* ink_drop() { return host_view_->ink_drop(); } | 29 InkDrop* ink_drop() { return host_view_->ink_drop(); } |
28 | 30 |
29 bool HasGestureHandler() const; | 31 bool HasGestureHandler() const; |
30 | 32 |
31 // Wrapper for InkDropHostView::GetInkDropCenterBasedOnLastEvent(). | 33 // Wrapper for InkDropHostView::GetInkDropCenterBasedOnLastEvent(). |
32 gfx::Point GetInkDropCenterBasedOnLastEvent() const; | 34 gfx::Point GetInkDropCenterBasedOnLastEvent() const; |
33 | 35 |
34 // Wrapper for InkDropHostView::AnimateInkDrop(). | 36 // Wrapper for InkDropHostView::AnimateInkDrop(). |
35 void AnimateInkDrop(InkDropState state, const ui::LocatedEvent* event); | 37 void AnimateInkDrop(InkDropState state, const ui::LocatedEvent* event); |
36 | 38 |
37 private: | 39 private: |
38 // The InkDropHostView to provide internal access to. | 40 // The InkDropHostView to provide internal access to. |
39 InkDropHostView* host_view_; | 41 InkDropHostView* host_view_; |
40 | 42 |
41 DISALLOW_COPY_AND_ASSIGN(InkDropHostViewTestApi); | 43 DISALLOW_COPY_AND_ASSIGN(InkDropHostViewTestApi); |
42 }; | 44 }; |
43 | 45 |
44 } // namespace test | 46 } // namespace test |
45 } // namespace views | 47 } // namespace views |
46 | 48 |
47 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_HOST_VIEW_TEST_API_H_ | 49 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_HOST_VIEW_TEST_API_H_ |
OLD | NEW |