| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/events/event_handler.h" | 10 #include "ui/events/event_handler.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // An InkDropDelegate that handles animations for things that act like buttons. | 24 // An InkDropDelegate that handles animations for things that act like buttons. |
| 25 class VIEWS_EXPORT ButtonInkDropDelegate : public InkDropDelegate, | 25 class VIEWS_EXPORT ButtonInkDropDelegate : public InkDropDelegate, |
| 26 public ui::EventHandler { | 26 public ui::EventHandler { |
| 27 public: | 27 public: |
| 28 ButtonInkDropDelegate(InkDropHost* ink_drop_host, View* view); | 28 ButtonInkDropDelegate(InkDropHost* ink_drop_host, View* view); |
| 29 ~ButtonInkDropDelegate() override; | 29 ~ButtonInkDropDelegate() override; |
| 30 | 30 |
| 31 // InkDropDelegate: | 31 // InkDropDelegate: |
| 32 void OnAction(InkDropState state) override; | 32 void OnAction(InkDropState state) override; |
| 33 void SnapToActivated() override; |
| 33 void SetHovered(bool is_hovered) override; | 34 void SetHovered(bool is_hovered) override; |
| 34 | 35 |
| 35 // ui::EventHandler: | 36 // ui::EventHandler: |
| 36 void OnMouseEvent(ui::MouseEvent* event) override; | 37 void OnMouseEvent(ui::MouseEvent* event) override; |
| 37 void OnGestureEvent(ui::GestureEvent* event) override; | 38 void OnGestureEvent(ui::GestureEvent* event) override; |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 // An instance of ScopedTargetHandler allowing |this| to handle events. | 41 // An instance of ScopedTargetHandler allowing |this| to handle events. |
| 41 scoped_ptr<ui::ScopedTargetHandler> target_handler_; | 42 scoped_ptr<ui::ScopedTargetHandler> target_handler_; |
| 42 | 43 |
| 43 // Parent InkDropHost (typically a View) that hosts the ink ripple animations. | 44 // Parent InkDropHost (typically a View) that hosts the ink ripple animations. |
| 44 InkDropHost* ink_drop_host_; | 45 InkDropHost* ink_drop_host_; |
| 45 | 46 |
| 46 // Animation controller for the ink drop ripple effect. | 47 // Animation controller for the ink drop ripple effect. |
| 47 scoped_ptr<InkDropAnimationController> ink_drop_animation_controller_; | 48 scoped_ptr<InkDropAnimationController> ink_drop_animation_controller_; |
| 48 | 49 |
| 49 DISALLOW_COPY_AND_ASSIGN(ButtonInkDropDelegate); | 50 DISALLOW_COPY_AND_ASSIGN(ButtonInkDropDelegate); |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 } // namespace views | 53 } // namespace views |
| 53 | 54 |
| 54 #endif // UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ | 55 #endif // UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ |
| OLD | NEW |