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

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 (moved ACTION_PENDING handling to toolbar_action_view for now) 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/scoped_target_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 }
17
18 namespace views {
19
20 class InkDropAnimationController;
21 class InkDropHost;
22
23 // An InkDropDelegate that handles animations for toolbar buttons.
24 class VIEWS_EXPORT ToolbarInkDropDelegate : public InkDropDelegate,
25 public ui::ScopedTargetHandler {
26 public:
27 ToolbarInkDropDelegate(InkDropHost* ink_drop_host, ui::EventTarget* target);
28 ~ToolbarInkDropDelegate() override;
29
30 // InkDropDelegate:
31 void SetInkDropSize(int large_size,
32 int large_corner_radius,
33 int small_size,
34 int small_corner_radius) override;
35 void OnLayout() override;
36 void OnAction(InkDropState state) override;
37
38 // ui::ScopedTargetHandler:
39 void OnGestureEvent(ui::GestureEvent* event) override;
40
41 private:
42 // If non-null the destructor sets this to true. This is set while handling
43 // an event and used to detect if |this| has been deleted.
44 bool* destroyed_flag_;
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698