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_INK_DROP_HOST_VIEW_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ |
6 #define UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 // Should return true if the ink drop is also used to depict focus. | 79 // Should return true if the ink drop is also used to depict focus. |
80 virtual bool ShouldShowInkDropForFocus() const; | 80 virtual bool ShouldShowInkDropForFocus() const; |
81 | 81 |
82 InkDrop* ink_drop() { return ink_drop_.get(); } | 82 InkDrop* ink_drop() { return ink_drop_.get(); } |
83 | 83 |
84 // Toggle to enable/disable an InkDrop on this View. Descendants can override | 84 // Toggle to enable/disable an InkDrop on this View. Descendants can override |
85 // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel | 85 // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel |
86 // of the InkDrop. | 86 // of the InkDrop. |
87 void SetHasInkDrop(bool has_an_ink_drop); | 87 void SetHasInkDrop(bool has_an_ink_drop); |
88 | 88 |
89 // An overload of SetHasInkDrop() that takes an extra argument specifying | |
90 // whether the default gesture handler should be installed for the ink drop or | |
91 // not. |handles_gesture_event| can only be true when |has_ink_drop| is true. | |
92 void SetHasInkDrop(bool has_an_ink_drop, bool handles_gesture_event); | |
James Cook
2016/06/23 20:08:08
Having a method that takes two bools side by side,
mohsen
2016/06/27 22:17:10
Right. I believe having two separate methods would
| |
93 | |
89 private: | 94 private: |
90 class InkDropGestureHandler; | 95 class InkDropGestureHandler; |
91 friend class InkDropGestureHandler; | 96 friend class InkDropGestureHandler; |
92 friend class test::InkDropHostViewTestApi; | 97 friend class test::InkDropHostViewTestApi; |
93 | 98 |
94 // The last user Event to trigger an ink drop ripple animation. | 99 // The last user Event to trigger an ink drop ripple animation. |
95 std::unique_ptr<ui::LocatedEvent> last_ripple_triggering_event_; | 100 std::unique_ptr<ui::LocatedEvent> last_ripple_triggering_event_; |
96 | 101 |
97 std::unique_ptr<InkDrop> ink_drop_; | 102 std::unique_ptr<InkDrop> ink_drop_; |
98 | 103 |
99 // Intentionally declared after |ink_drop_| so that it doesn't access a | 104 // Intentionally declared after |ink_drop_| so that it doesn't access a |
100 // destroyed |ink_drop_| during destruction. | 105 // destroyed |ink_drop_| during destruction. |
101 std::unique_ptr<InkDropGestureHandler> gesture_handler_; | 106 std::unique_ptr<InkDropGestureHandler> gesture_handler_; |
102 | 107 |
103 gfx::Size ink_drop_size_; | 108 gfx::Size ink_drop_size_; |
104 | 109 |
105 float ink_drop_visible_opacity_; | 110 float ink_drop_visible_opacity_; |
106 | 111 |
107 // Determines whether the view was already painting to layer before adding ink | 112 // Determines whether the view was already painting to layer before adding ink |
108 // drop layer. | 113 // drop layer. |
109 bool old_paint_to_layer_; | 114 bool old_paint_to_layer_; |
110 | 115 |
111 bool destroying_; | 116 bool destroying_; |
112 | 117 |
113 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); | 118 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); |
114 }; | 119 }; |
115 } // namespace views | 120 } // namespace views |
116 | 121 |
117 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ | 122 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ |
OLD | NEW |