| 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 16 matching lines...) Expand all Loading... |
| 27 class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { | 27 class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { |
| 28 public: | 28 public: |
| 29 InkDropHostView(); | 29 InkDropHostView(); |
| 30 ~InkDropHostView() override; | 30 ~InkDropHostView() override; |
| 31 | 31 |
| 32 // Overridden from InkDropHost: | 32 // Overridden from InkDropHost: |
| 33 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; | 33 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; |
| 34 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; | 34 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; |
| 35 std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; | 35 std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; |
| 36 std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override; | 36 std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override; |
| 37 void OffsetInkDropRipple(const gfx::Vector2d& offset) override; |
| 37 | 38 |
| 38 void set_ink_drop_size(const gfx::Size& size) { ink_drop_size_ = size; } | 39 void set_ink_drop_size(const gfx::Size& size) { ink_drop_size_ = size; } |
| 39 | 40 |
| 40 protected: | 41 protected: |
| 41 // Used in SetInkDropMode() to specify whether the ink drop effect is enabled | 42 // Used in SetInkDropMode() to specify whether the ink drop effect is enabled |
| 42 // or not for the view. In case of having an ink drop, it also specifies | 43 // or not for the view. In case of having an ink drop, it also specifies |
| 43 // whether the default gesture event handler for the ink drop should be | 44 // whether the default gesture event handler for the ink drop should be |
| 44 // installed or the subclass will handle gesture events itself. | 45 // installed or the subclass will handle gesture events itself. |
| 45 enum class InkDropMode { | 46 enum class InkDropMode { |
| 46 OFF, | 47 OFF, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 104 |
| 104 // The last user Event to trigger an ink drop ripple animation. | 105 // The last user Event to trigger an ink drop ripple animation. |
| 105 std::unique_ptr<ui::LocatedEvent> last_ripple_triggering_event_; | 106 std::unique_ptr<ui::LocatedEvent> last_ripple_triggering_event_; |
| 106 | 107 |
| 107 std::unique_ptr<InkDrop> ink_drop_; | 108 std::unique_ptr<InkDrop> ink_drop_; |
| 108 | 109 |
| 109 // Intentionally declared after |ink_drop_| so that it doesn't access a | 110 // Intentionally declared after |ink_drop_| so that it doesn't access a |
| 110 // destroyed |ink_drop_| during destruction. | 111 // destroyed |ink_drop_| during destruction. |
| 111 std::unique_ptr<InkDropGestureHandler> gesture_handler_; | 112 std::unique_ptr<InkDropGestureHandler> gesture_handler_; |
| 112 | 113 |
| 114 // Cached ink drop layer. |
| 115 ui::Layer* ink_drop_layer_; |
| 116 |
| 113 gfx::Size ink_drop_size_; | 117 gfx::Size ink_drop_size_; |
| 114 | 118 |
| 115 float ink_drop_visible_opacity_; | 119 float ink_drop_visible_opacity_; |
| 116 | 120 |
| 117 // Determines whether the view was already painting to layer before adding ink | 121 // Determines whether the view was already painting to layer before adding ink |
| 118 // drop layer. | 122 // drop layer. |
| 119 bool old_paint_to_layer_; | 123 bool old_paint_to_layer_; |
| 120 | 124 |
| 121 bool destroying_; | 125 bool destroying_; |
| 122 | 126 |
| 123 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); | 127 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); |
| 124 }; | 128 }; |
| 125 } // namespace views | 129 } // namespace views |
| 126 | 130 |
| 127 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ | 131 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ |
| OLD | NEW |