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 "ui/events/event_handler.h" | |
| 10 #include "ui/views/animation/ink_drop_delegate.h" | |
| 11 #include "ui/views/views_export.h" | |
| 12 | |
| 13 namespace views { | |
| 14 | |
| 15 class InkDropAnimationController; | |
| 16 class InkDropHost; | |
| 17 class View; | |
| 18 | |
| 19 // An InkDropDelegate that handles animations for toolbar buttons. | |
| 20 class VIEWS_EXPORT ToolbarInkDropDelegate : public InkDropDelegate, | |
| 21 public ui::EventHandler { | |
| 22 public: | |
| 23 ToolbarInkDropDelegate(InkDropHost* ink_drop_host, | |
| 24 View* view); | |
| 25 ~ToolbarInkDropDelegate() override; | |
| 26 | |
| 27 // InkDropDelegate: | |
| 28 void SetInkDropSize(int large_size, | |
| 29 int large_corner_radius, | |
| 30 int small_size, | |
| 31 int small_corner_radius) override; | |
| 32 void OnLayout() override; | |
| 33 void OnActionComplete() override; | |
| 34 void OnActionPending() override; | |
| 35 void OnActionQuick() override; | |
| 36 void OnActivated() override; | |
| 37 void OnDeactivated() override; | |
| 38 | |
| 39 // ui::EventHandler: | |
| 40 void OnEvent(ui::Event* event) override; | |
| 41 void OnKeyEvent(ui::KeyEvent* event) override; | |
| 42 void OnMouseEvent(ui::MouseEvent* event) override; | |
| 43 void OnScrollEvent(ui::ScrollEvent* event) override; | |
| 44 void OnTouchEvent(ui::TouchEvent* event) override; | |
| 45 void OnGestureEvent(ui::GestureEvent* event) override; | |
| 46 void OnCancelMode(ui::CancelModeEvent* event) override; | |
| 47 | |
| 48 private: | |
| 49 // View that allows this class to handle events before or after | |
| 50 // |view_| gets a chance to handle them. | |
| 51 View* view_; | |
|
bruthig
2015/11/16 22:37:11
Do we actually need to interface with View specifi
varkha
2015/11/18 22:56:44
Done.
| |
| 52 | |
| 53 // Pass events to |original_event_handler_| if it was set. | |
| 54 ui::EventHandler* original_event_handler_; | |
| 55 | |
| 56 // Parent InkDropHost (typically a View) that hosts the ink ripple animations. | |
| 57 InkDropHost* ink_drop_host_; | |
| 58 | |
| 59 // Animation controller for the ink drop ripple effect. | |
| 60 scoped_ptr<InkDropAnimationController> ink_drop_animation_controller_; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(ToolbarInkDropDelegate); | |
| 63 }; | |
| 64 | |
| 65 } // namespace views | |
| 66 | |
| 67 #endif // UI_VIEWS_ANIMATION_TOOLBAR_INK_DROP_DELEGATE_H_ | |
| OLD | NEW |