Chromium Code Reviews| 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_TOOLBAR_INK_DROP_DELEGATE_H_ | |
| 6 #define UI_VIEWS_ANIMATION_TOOLBAR_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 ui { | |
| 15 class EventTarget; | |
| 16 class ScopedTargetHandler; | |
| 17 } | |
| 18 | |
| 19 namespace views { | |
| 20 | |
| 21 class InkDropAnimationController; | |
| 22 class InkDropHost; | |
| 23 | |
| 24 // An InkDropDelegate that handles animations for toolbar buttons. | |
| 25 class VIEWS_EXPORT ToolbarInkDropDelegate : public InkDropDelegate, | |
|
sadrul
2015/11/25 22:38:58
I would call this ButtonInkDropDelegate
varkha
2015/11/26 00:05:46
Done.
| |
| 26 public ui::EventHandler { | |
| 27 public: | |
| 28 ToolbarInkDropDelegate(InkDropHost* ink_drop_host, ui::EventTarget* target); | |
| 29 ~ToolbarInkDropDelegate() override; | |
| 30 | |
| 31 // InkDropDelegate: | |
| 32 void SetInkDropSize(int large_size, | |
| 33 int large_corner_radius, | |
| 34 int small_size, | |
| 35 int small_corner_radius) override; | |
| 36 void OnBoundsChanged() override; | |
| 37 void OnAction(InkDropState state) override; | |
| 38 | |
| 39 // ui::EventHandler: | |
| 40 void OnGestureEvent(ui::GestureEvent* event) override; | |
| 41 | |
| 42 private: | |
| 43 // An instance of ScopedTargetHandler allowing |this| to handling events. | |
| 44 scoped_ptr<ui::ScopedTargetHandler> target_handler_; | |
| 45 | |
| 46 // Parent InkDropHost (typically a View) that hosts the ink ripple animations. | |
| 47 InkDropHost* ink_drop_host_; | |
| 48 | |
| 49 // Animation controller for the ink drop ripple effect. | |
| 50 scoped_ptr<InkDropAnimationController> ink_drop_animation_controller_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(ToolbarInkDropDelegate); | |
| 53 }; | |
| 54 | |
| 55 } // namespace views | |
| 56 | |
| 57 #endif // UI_VIEWS_ANIMATION_TOOLBAR_INK_DROP_DELEGATE_H_ | |
| OLD | NEW |