OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ |
| 6 #define UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/events/event_handler.h" |
| 11 #include "ui/views/animation/ink_drop_delegate.h" |
| 12 #include "ui/views/views_export.h" |
| 13 |
| 14 namespace views { |
| 15 |
| 16 class InkDropAnimationController; |
| 17 class InkDropHost; |
| 18 class ScopedTargetHandler; |
| 19 class View; |
| 20 |
| 21 // An InkDropDelegate that handles animations for toolbar buttons. |
| 22 class VIEWS_EXPORT ButtonInkDropDelegate : public InkDropDelegate, |
| 23 public ui::EventHandler { |
| 24 public: |
| 25 ButtonInkDropDelegate(InkDropHost* ink_drop_host, View* view); |
| 26 ~ButtonInkDropDelegate() override; |
| 27 |
| 28 // InkDropDelegate: |
| 29 void SetInkDropSize(int large_size, |
| 30 int large_corner_radius, |
| 31 int small_size, |
| 32 int small_corner_radius) override; |
| 33 void OnLayout() override; |
| 34 void OnAction(InkDropState state) override; |
| 35 |
| 36 // ui::EventHandler: |
| 37 void OnGestureEvent(ui::GestureEvent* event) override; |
| 38 |
| 39 private: |
| 40 // An instance of ScopedTargetHandler allowing |this| to handling events. |
| 41 scoped_ptr<views::ScopedTargetHandler> target_handler_; |
| 42 |
| 43 // Parent InkDropHost (typically a View) that hosts the ink ripple animations. |
| 44 InkDropHost* ink_drop_host_; |
| 45 |
| 46 // Animation controller for the ink drop ripple effect. |
| 47 scoped_ptr<InkDropAnimationController> ink_drop_animation_controller_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(ButtonInkDropDelegate); |
| 50 }; |
| 51 |
| 52 } // namespace views |
| 53 |
| 54 #endif // UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_ |
OLD | NEW |