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

Side by Side Diff: components/exo/pointer_delegate.h

Issue 1750633002: components/exo: Extend pointer to use v5 protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests Created 4 years, 9 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_EXO_POINTER_DELEGATE_H_ 5 #ifndef COMPONENTS_EXO_POINTER_DELEGATE_H_
6 #define COMPONENTS_EXO_POINTER_DELEGATE_H_ 6 #define COMPONENTS_EXO_POINTER_DELEGATE_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "ui/events/event_constants.h" 9 #include "ui/events/event_constants.h"
10 10
11 namespace gfx { 11 namespace gfx {
12 class Point; 12 class Point;
13 class Vector2d; 13 class Vector2dF;
14 } 14 }
15 15
16 namespace exo { 16 namespace exo {
17 class Pointer; 17 class Pointer;
18 class Surface; 18 class Surface;
19 19
20 // Handles events on pointers in context-specific ways. 20 // Handles events on pointers in context-specific ways.
21 class PointerDelegate { 21 class PointerDelegate {
22 public: 22 public:
23 // Called at the top of the pointer's destructor, to give observers a 23 // Called at the top of the pointer's destructor, to give observers a
(...skipping 18 matching lines...) Expand all
42 virtual void OnPointerMotion(base::TimeDelta time_stamp, 42 virtual void OnPointerMotion(base::TimeDelta time_stamp,
43 const gfx::Point& location) = 0; 43 const gfx::Point& location) = 0;
44 44
45 // Called when pointer button state changed. |changed_button_flags| contains 45 // Called when pointer button state changed. |changed_button_flags| contains
46 // all buttons that changed. |pressed| is true if buttons entered pressed 46 // all buttons that changed. |pressed| is true if buttons entered pressed
47 // state. 47 // state.
48 virtual void OnPointerButton(base::TimeDelta time_stamp, 48 virtual void OnPointerButton(base::TimeDelta time_stamp,
49 int changed_button_flags, 49 int changed_button_flags,
50 bool pressed) = 0; 50 bool pressed) = 0;
51 51
52 // Called when pointer wheel changed. |offset| contains the direction and 52 // Called when pointer is scrolling. |offset| contains the direction and
53 // distance of the change. 53 // distance of the change. |discrete| is true if the scrolling is caused
54 virtual void OnPointerWheel(base::TimeDelta time_stamp, 54 // by a discrete device such as a scroll wheel.
55 const gfx::Vector2d& offset) = 0; 55 virtual void OnPointerScroll(base::TimeDelta time_stamp,
56 const gfx::Vector2dF& offset,
57 bool discrete) = 0;
58
59 // Called when pointer scroll has stopped and a fling is happening (e.g.
60 // lifting the fingers from the touchpad after scrolling quickly)
61 virtual void OnPointerScrollStop(base::TimeDelta time_stamp) = 0;
62
63 // Called after all pointer information of this frame has been set and the
64 // client should evaluate the updated state. No events are being sent before
65 // this method is called.
66 virtual void OnPointerFrame() = 0;
56 67
57 protected: 68 protected:
58 virtual ~PointerDelegate() {} 69 virtual ~PointerDelegate() {}
59 }; 70 };
60 71
61 } // namespace exo 72 } // namespace exo
62 73
63 #endif // COMPONENTS_EXO_POINTER_DELEGATE_H_ 74 #endif // COMPONENTS_EXO_POINTER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698