Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: ui/views/animation/toolbar_ink_drop_delegate.h

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor ink drop animations (simplify MenuButton) Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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,
26 public ui::EventHandler {
27 public:
28 ToolbarInkDropDelegate(InkDropHost* ink_drop_host,
29 ui::EventTarget* target);
30 ~ToolbarInkDropDelegate() override;
31
32 // InkDropDelegate:
33 void SetInkDropSize(int large_size,
34 int large_corner_radius,
35 int small_size,
36 int small_corner_radius) override;
37 void OnLayout() override;
38 void OnAction(InkDropState state) override;
39
40 // ui::EventHandler:
41 void OnEvent(ui::Event* event) override;
42 void OnKeyEvent(ui::KeyEvent* event) override;
43 void OnMouseEvent(ui::MouseEvent* event) override;
44 void OnScrollEvent(ui::ScrollEvent* event) override;
45 void OnTouchEvent(ui::TouchEvent* event) override;
46 void OnGestureEvent(ui::GestureEvent* event) override;
47 void OnCancelMode(ui::CancelModeEvent* event) override;
48
49 private:
50 // An EventHandler that gets a chance to handle events before or after |this|.
51 ui::EventHandler* event_handler_;
52
53 // Safely replaces a target handler for the lifetime of |this|.
54 scoped_ptr<ui::ScopedTargetHandler> target_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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698