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

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

Issue 2041033002: Moved ButtonInkDropDelegate logic into InkDropHostView and deleted InkDropDelegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed merge conflict in custom_button.cc Created 4 years, 6 months 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_BUTTON_INK_DROP_DELEGATE_H_
6 #define UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "ui/events/event_handler.h"
12 #include "ui/gfx/geometry/point.h"
13 #include "ui/views/animation/ink_drop_delegate.h"
14 #include "ui/views/views_export.h"
15
16 namespace ui {
17 class ScopedTargetHandler;
18 }
19
20 namespace views {
21
22 class InkDrop;
23 class InkDropHost;
24 class View;
25
26 // An InkDropDelegate that handles animations for things that act like buttons.
27 class VIEWS_EXPORT ButtonInkDropDelegate : public InkDropDelegate,
28 public ui::EventHandler {
29 public:
30 ButtonInkDropDelegate(InkDropHost* ink_drop_host, View* view);
31 ~ButtonInkDropDelegate() override;
32
33 const gfx::Point& last_ink_drop_location() const {
34 return last_ink_drop_location_;
35 }
36 void set_last_ink_drop_location(const gfx::Point& point) {
37 last_ink_drop_location_ = point;
38 }
39
40 // InkDropDelegate:
41 void OnAction(InkDropState state) override;
42 void SnapToActivated() override;
43 void SetHovered(bool is_hovered) override;
44 InkDropState GetTargetInkDropState() const override;
45 InkDrop* GetInkDrop() override;
46
47 // ui::EventHandler:
48 void OnMouseEvent(ui::MouseEvent* event) override;
49 void OnGestureEvent(ui::GestureEvent* event) override;
50
51 private:
52 // An instance of ScopedTargetHandler allowing |this| to handle events.
53 std::unique_ptr<ui::ScopedTargetHandler> target_handler_;
54
55 // Parent InkDropHost (typically a View) that hosts the ink ripple animations.
56 InkDropHost* ink_drop_host_;
57
58 // Location of the last ink drop triggering event in coordinate system of the
59 // ctor argument |view|.
60 gfx::Point last_ink_drop_location_;
61
62 // Animation controller for the ink drop ripple effect.
63 std::unique_ptr<InkDrop> ink_drop_;
64
65 DISALLOW_COPY_AND_ASSIGN(ButtonInkDropDelegate);
66 };
67
68 } // namespace views
69
70 #endif // UI_VIEWS_ANIMATION_BUTTON_INK_DROP_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.cc ('k') | ui/views/animation/button_ink_drop_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698