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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // Subclasses can override to return a mask for the ink drop. By default, | 108 // Subclasses can override to return a mask for the ink drop. By default, |
109 // returns nullptr (i.e no mask). | 109 // returns nullptr (i.e no mask). |
110 virtual std::unique_ptr<views::InkDropMask> CreateInkDropMask() const; | 110 virtual std::unique_ptr<views::InkDropMask> CreateInkDropMask() const; |
111 | 111 |
112 // Provides access to |ink_drop_|. Implements lazy initialization of | 112 // Provides access to |ink_drop_|. Implements lazy initialization of |
113 // |ink_drop_| so as to avoid virtual method calls during construction since | 113 // |ink_drop_| so as to avoid virtual method calls during construction since |
114 // subclasses should be able to call SetInkDropMode() during construction. | 114 // subclasses should be able to call SetInkDropMode() during construction. |
115 InkDrop* GetInkDrop(); | 115 InkDrop* GetInkDrop(); |
116 | 116 |
| 117 // Initializes and sets a mask on |ink_drop_layer|. No-op if |
| 118 // CreateInkDropMask() returns null. |
| 119 void InstallInkDropMask(ui::Layer* ink_drop_layer); |
| 120 |
| 121 void ResetInkDropMask(); |
| 122 |
117 // Returns an InkDropImpl configured to work well with a | 123 // Returns an InkDropImpl configured to work well with a |
118 // flood-fill ink drop ripple. | 124 // flood-fill ink drop ripple. |
119 std::unique_ptr<InkDropImpl> CreateDefaultFloodFillInkDropImpl(); | 125 std::unique_ptr<InkDropImpl> CreateDefaultFloodFillInkDropImpl(); |
120 | 126 |
121 // Returns an InkDropImpl with default configuration. The base implementation | 127 // Returns an InkDropImpl with default configuration. The base implementation |
122 // of CreateInkDrop() delegates to this function. | 128 // of CreateInkDrop() delegates to this function. |
123 std::unique_ptr<InkDropImpl> CreateDefaultInkDropImpl(); | 129 std::unique_ptr<InkDropImpl> CreateDefaultInkDropImpl(); |
124 | 130 |
125 private: | 131 private: |
126 class InkDropGestureHandler; | 132 class InkDropGestureHandler; |
(...skipping 21 matching lines...) Expand all Loading... |
148 | 154 |
149 bool destroying_; | 155 bool destroying_; |
150 | 156 |
151 std::unique_ptr<views::InkDropMask> ink_drop_mask_; | 157 std::unique_ptr<views::InkDropMask> ink_drop_mask_; |
152 | 158 |
153 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); | 159 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); |
154 }; | 160 }; |
155 } // namespace views | 161 } // namespace views |
156 | 162 |
157 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ | 163 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ |
OLD | NEW |