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

Side by Side Diff: ui/events/event.h

Issue 2029713002: Constructors for ui::MouseEvent/ui::TouchEvent from ui::PointerEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_EVENTS_EVENT_H_ 5 #ifndef UI_EVENTS_EVENT_H_
6 #define UI_EVENTS_EVENT_H_ 6 #define UI_EVENTS_EVENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 // lie in [-90,90]. A positive tilt_x is to the right and a positive tilt_y 458 // lie in [-90,90]. A positive tilt_x is to the right and a positive tilt_y
459 // is towards the user. 0.0 if unknown. 459 // is towards the user. 0.0 if unknown.
460 float tilt_x = 0.0; 460 float tilt_x = 0.0;
461 float tilt_y = 0.0; 461 float tilt_y = 0.0;
462 }; 462 };
463 463
464 class EVENTS_EXPORT MouseEvent : public LocatedEvent { 464 class EVENTS_EXPORT MouseEvent : public LocatedEvent {
465 public: 465 public:
466 explicit MouseEvent(const base::NativeEvent& native_event); 466 explicit MouseEvent(const base::NativeEvent& native_event);
467 467
468 // |pointer_event.IsMousePointerEvent()| must be true.
469 explicit MouseEvent(const PointerEvent& pointer_event);
470
468 // Create a new MouseEvent based on the provided model. 471 // Create a new MouseEvent based on the provided model.
469 // Uses the provided |type| and |flags| for the new event. 472 // Uses the provided |type| and |flags| for the new event.
470 // If source / target windows are provided, the model location will be 473 // If source / target windows are provided, the model location will be
471 // converted from |source| coordinate system to |target| coordinate system. 474 // converted from |source| coordinate system to |target| coordinate system.
472 template <class T> 475 template <class T>
473 MouseEvent(const MouseEvent& model, T* source, T* target) 476 MouseEvent(const MouseEvent& model, T* source, T* target)
474 : LocatedEvent(model, source, target), 477 : LocatedEvent(model, source, target),
475 changed_button_flags_(model.changed_button_flags_), 478 changed_button_flags_(model.changed_button_flags_),
476 pointer_details_(model.pointer_details_) {} 479 pointer_details_(model.pointer_details_) {}
477 480
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 friend struct IPC::ParamTraits<ui::ScopedEvent>; 636 friend struct IPC::ParamTraits<ui::ScopedEvent>;
634 friend struct IPC::ParamTraits<ui::MouseWheelEvent>; 637 friend struct IPC::ParamTraits<ui::MouseWheelEvent>;
635 638
636 gfx::Vector2d offset_; 639 gfx::Vector2d offset_;
637 }; 640 };
638 641
639 class EVENTS_EXPORT TouchEvent : public LocatedEvent { 642 class EVENTS_EXPORT TouchEvent : public LocatedEvent {
640 public: 643 public:
641 explicit TouchEvent(const base::NativeEvent& native_event); 644 explicit TouchEvent(const base::NativeEvent& native_event);
642 645
646 // |pointer_event.IsTouchPointerEvent()| must be true.
647 explicit TouchEvent(const PointerEvent& pointer_event);
648
643 // Create a new TouchEvent which is identical to the provided model. 649 // Create a new TouchEvent which is identical to the provided model.
644 // If source / target windows are provided, the model location will be 650 // If source / target windows are provided, the model location will be
645 // converted from |source| coordinate system to |target| coordinate system. 651 // converted from |source| coordinate system to |target| coordinate system.
646 template <class T> 652 template <class T>
647 TouchEvent(const TouchEvent& model, T* source, T* target) 653 TouchEvent(const TouchEvent& model, T* source, T* target)
648 : LocatedEvent(model, source, target), 654 : LocatedEvent(model, source, target),
649 touch_id_(model.touch_id_), 655 touch_id_(model.touch_id_),
650 unique_event_id_(model.unique_event_id_), 656 unique_event_id_(model.unique_event_id_),
651 rotation_angle_(model.rotation_angle_), 657 rotation_angle_(model.rotation_angle_),
652 may_cause_scrolling_(model.may_cause_scrolling_), 658 may_cause_scrolling_(model.may_cause_scrolling_),
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 : LocatedEvent(type, time_stamp, flags) {} 1074 : LocatedEvent(type, time_stamp, flags) {}
1069 friend struct IPC::ParamTraits<ui::ScopedEvent>; 1075 friend struct IPC::ParamTraits<ui::ScopedEvent>;
1070 friend struct IPC::ParamTraits<ui::GestureEvent>; 1076 friend struct IPC::ParamTraits<ui::GestureEvent>;
1071 1077
1072 GestureEventDetails details_; 1078 GestureEventDetails details_;
1073 }; 1079 };
1074 1080
1075 } // namespace ui 1081 } // namespace ui
1076 1082
1077 #endif // UI_EVENTS_EVENT_H_ 1083 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698