Chromium Code Reviews| Index: ui/base/events/event.h |
| diff --git a/ui/base/events/event.h b/ui/base/events/event.h |
| index b691118c064954ffd7b74149ad0541340fdaec1a..b498824207923a5a45c048f1dc6284324c32ebd6 100644 |
| --- a/ui/base/events/event.h |
| +++ b/ui/base/events/event.h |
| @@ -9,6 +9,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/event_types.h" |
| #include "base/logging.h" |
| +#include "base/memory/singleton.h" |
| #include "base/time.h" |
| #include "ui/base/dragdrop/os_exchange_data.h" |
| #include "ui/base/events/event_constants.h" |
| @@ -438,6 +439,25 @@ class UI_EXPORT MouseWheelEvent : public MouseEvent { |
| DISALLOW_COPY_AND_ASSIGN(MouseWheelEvent); |
| }; |
| +#if defined(USE_XI2_MT) |
| +class TouchCoordinatesCalibrator { |
|
sadrul
2013/02/04 19:10:22
Add doc
ynovikov
2013/03/13 23:34:21
Done.
|
| +public: |
| + static TouchCoordinatesCalibrator* GetInstance(); |
| + void Calibrate(TouchEvent& event, const gfx::Rect& bounds); |
|
sadrul
2013/02/04 19:10:22
You should either use a const ref, or a pointer.
ynovikov
2013/03/13 23:34:21
Done.
|
| +private: |
| + TouchCoordinatesCalibrator(); |
| + friend struct DefaultSingletonTraits<TouchCoordinatesCalibrator>; |
| + |
| + // The (positive) calibration values for the four border sides. |
| + int left_border_touch_calibration; |
|
sadrul
2013/02/04 19:10:22
You can probably just call these left_, right_, to
ynovikov
2013/03/13 23:34:21
Done.
|
| + int right_border_touch_calibration; |
| + int top_border_touch_calibration; |
| + int bottom_border_touch_calibration; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TouchCoordinatesCalibrator); |
| +}; |
| +#endif |
| + |
| class UI_EXPORT TouchEvent : public LocatedEvent { |
| public: |
| explicit TouchEvent(const base::NativeEvent& native_event); |
| @@ -483,6 +503,10 @@ class UI_EXPORT TouchEvent : public LocatedEvent { |
| // and it needs to be mapped into Aura Root Window coordinates. |
| void Relocate(const gfx::Point& origin); |
| +#if defined(USE_XI2_MT) |
| + void Calibrate(const gfx::Rect& bounds); |
| +#endif |
| + |
| // Used for unit tests. |
| void set_radius_x(const float r) { radius_x_ = r; } |
| void set_radius_y(const float r) { radius_y_ = r; } |