| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BUTTON_INK_DROP_DELEGATE_H_ | 5 #ifndef UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ |
| 6 #define UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ | 6 #define UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 return last_ink_drop_location_; | 34 return last_ink_drop_location_; |
| 35 } | 35 } |
| 36 void set_last_ink_drop_location(const gfx::Point& point) { | 36 void set_last_ink_drop_location(const gfx::Point& point) { |
| 37 last_ink_drop_location_ = point; | 37 last_ink_drop_location_ = point; |
| 38 } | 38 } |
| 39 | 39 |
| 40 // InkDropDelegate: | 40 // InkDropDelegate: |
| 41 void OnAction(InkDropState state) override; | 41 void OnAction(InkDropState state) override; |
| 42 void SnapToActivated() override; | 42 void SnapToActivated() override; |
| 43 void SetHovered(bool is_hovered) override; | 43 void SetHovered(bool is_hovered) override; |
| 44 InkDropState GetTargetInkDropState() const override; |
| 44 | 45 |
| 45 // ui::EventHandler: | 46 // ui::EventHandler: |
| 46 void OnMouseEvent(ui::MouseEvent* event) override; | 47 void OnMouseEvent(ui::MouseEvent* event) override; |
| 47 void OnGestureEvent(ui::GestureEvent* event) override; | 48 void OnGestureEvent(ui::GestureEvent* event) override; |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 // An instance of ScopedTargetHandler allowing |this| to handle events. | 51 // An instance of ScopedTargetHandler allowing |this| to handle events. |
| 51 std::unique_ptr<ui::ScopedTargetHandler> target_handler_; | 52 std::unique_ptr<ui::ScopedTargetHandler> target_handler_; |
| 52 | 53 |
| 53 // Parent InkDropHost (typically a View) that hosts the ink ripple animations. | 54 // Parent InkDropHost (typically a View) that hosts the ink ripple animations. |
| 54 InkDropHost* ink_drop_host_; | 55 InkDropHost* ink_drop_host_; |
| 55 | 56 |
| 56 // Location of the last ink drop triggering event in coordinate system of the | 57 // Location of the last ink drop triggering event in coordinate system of the |
| 57 // ctor argument |view|. | 58 // ctor argument |view|. |
| 58 gfx::Point last_ink_drop_location_; | 59 gfx::Point last_ink_drop_location_; |
| 59 | 60 |
| 60 // Animation controller for the ink drop ripple effect. | 61 // Animation controller for the ink drop ripple effect. |
| 61 std::unique_ptr<InkDrop> ink_drop_; | 62 std::unique_ptr<InkDrop> ink_drop_; |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(ButtonInkDropDelegate); | 64 DISALLOW_COPY_AND_ASSIGN(ButtonInkDropDelegate); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace views | 67 } // namespace views |
| 67 | 68 |
| 68 #endif // UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ | 69 #endif // UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ |
| OLD | NEW |