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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Should return true if the ink drop is also used to depict focus. | 53 // Should return true if the ink drop is also used to depict focus. |
54 virtual bool ShouldShowInkDropForFocus() const; | 54 virtual bool ShouldShowInkDropForFocus() const; |
55 | 55 |
56 InkDrop* ink_drop() { return ink_drop_.get(); } | 56 InkDrop* ink_drop() { return ink_drop_.get(); } |
57 | 57 |
58 // Toggle to enable/disable an InkDrop on this View. Descendants can override | 58 // Toggle to enable/disable an InkDrop on this View. Descendants can override |
59 // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel | 59 // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel |
60 // of the InkDrop. | 60 // of the InkDrop. |
61 void SetHasInkDrop(bool has_an_ink_drop); | 61 void SetHasInkDrop(bool has_an_ink_drop); |
62 | 62 |
| 63 // An overload of SetHasInkDrop() that takes an extra argument specifying |
| 64 // whether the default gesture handler should be installed for the ink drop or |
| 65 // not. |handles_gesture_event| can only be true when |has_ink_drop| is true. |
| 66 void SetHasInkDrop(bool has_an_ink_drop, bool handles_gesture_event); |
| 67 |
63 // Animates |ink_drop_| to the desired |ink_drop_state|. | 68 // Animates |ink_drop_| to the desired |ink_drop_state|. |
64 // | 69 // |
65 // TODO(bruthig): Enhance to accept a ui::Event parameter so InkDrops can be | 70 // TODO(bruthig): Enhance to accept a ui::Event parameter so InkDrops can be |
66 // centered (see https://crbug.com/597273) and disabled for touch events on | 71 // centered (see https://crbug.com/597273) and disabled for touch events on |
67 // Windows (see https://crbug.com/595315). | 72 // Windows (see https://crbug.com/595315). |
68 void AnimateInkDrop(InkDropState ink_drop_state); | 73 void AnimateInkDrop(InkDropState ink_drop_state); |
69 | 74 |
70 private: | 75 private: |
71 class InkDropGestureHandler; | 76 class InkDropGestureHandler; |
72 friend class test::InkDropHostViewTestApi; | 77 friend class test::InkDropHostViewTestApi; |
(...skipping 10 matching lines...) Expand all Loading... |
83 // drop layer. | 88 // drop layer. |
84 bool old_paint_to_layer_; | 89 bool old_paint_to_layer_; |
85 | 90 |
86 bool destroying_; | 91 bool destroying_; |
87 | 92 |
88 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); | 93 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); |
89 }; | 94 }; |
90 } // namespace views | 95 } // namespace views |
91 | 96 |
92 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ | 97 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ |
OLD | NEW |