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

Unified Diff: ui/events/event.h

Issue 132123004: Target touches to the correct display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window_targeter.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 596f31e78b10ec6d45d8b2edca68f047b986fdbb..55687035af681322f0a0cd10259d19661829646c 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -437,7 +437,8 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
radius_x_(model.radius_x_),
radius_y_(model.radius_y_),
rotation_angle_(model.rotation_angle_),
- force_(model.force_) {
+ force_(model.force_),
+ source_device_id_(model.source_device_id_) {
}
TouchEvent(EventType type,
@@ -462,6 +463,7 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
float radius_y() const { return radius_y_; }
float rotation_angle() const { return rotation_angle_; }
float force() const { return force_; }
+ int source_device_id() const { return source_device_id_; }
// Relocate the touch-point to a new |origin|.
// This is useful when touch event is in X Root Window coordinates,
@@ -471,6 +473,9 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
// Used for unit tests.
void set_radius_x(const float r) { radius_x_ = r; }
void set_radius_y(const float r) { radius_y_ = r; }
+ void set_source_device_id(int source_device_id) {
+ source_device_id_ = source_device_id;
+ }
// Overridden from LocatedEvent.
virtual void UpdateForRootTransform(
@@ -504,6 +509,9 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
// Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
float force_;
+
+ // The device id of the screen the event came from. Default to be -1.
+ int source_device_id_;
};
class EVENTS_EXPORT KeyEvent : public Event {
« no previous file with comments | « ui/aura/window_targeter.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698