Chromium Code Reviews| Index: ui/display/manager/chromeos/touch_transform_controller.h |
| diff --git a/ui/display/manager/chromeos/touch_transform_controller.h b/ui/display/manager/chromeos/touch_transform_controller.h |
| index b911a311feceb45e95405369a7ed8319f2a3e96e..5ad6007c918426ede302065ce035ca8f5cb38e7c 100644 |
| --- a/ui/display/manager/chromeos/touch_transform_controller.h |
| +++ b/ui/display/manager/chromeos/touch_transform_controller.h |
| @@ -5,6 +5,10 @@ |
| #ifndef UI_DISPLAY_MANAGER_CHROMEOS_TOUCH_TRANSFORM_CONTROLLER_H_ |
| #define UI_DISPLAY_MANAGER_CHROMEOS_TOUCH_TRANSFORM_CONTROLLER_H_ |
| +#include <map> |
| +#include <memory> |
| +#include <vector> |
| + |
| #include "base/macros.h" |
| #include "ui/display/manager/display_manager_export.h" |
| #include "ui/gfx/geometry/size.h" |
| @@ -20,6 +24,9 @@ namespace display { |
| class DisplayConfigurator; |
| class DisplayManager; |
| class ManagedDisplayInfo; |
| +class TouchTransformSetter; |
| + |
| +struct TouchDeviceTransform; |
| namespace test { |
| class TouchTransformControllerTest; |
| @@ -31,7 +38,8 @@ class TouchTransformControllerTest; |
| class DISPLAY_MANAGER_EXPORT TouchTransformController { |
| public: |
| TouchTransformController(DisplayConfigurator* display_configurator, |
| - DisplayManager* display_manager); |
| + DisplayManager* display_manager, |
| + std::unique_ptr<TouchTransformSetter> setter); |
| ~TouchTransformController(); |
| // Updates the transform for touch input-devices and pushes the new transforms |
| @@ -45,6 +53,17 @@ class DISPLAY_MANAGER_EXPORT TouchTransformController { |
| private: |
| friend class test::TouchTransformControllerTest; |
| + // Contains the data that is passed to TouchTransformSetter. |
| + struct UpdateData { |
| + UpdateData(); |
| + ~UpdateData(); |
| + |
| + std::map<int32_t, double> device_to_scale; |
| + std::vector<TouchDeviceTransform> touch_device_transforms; |
| + }; |
| + |
| + void UpdateTouchTransforms(UpdateData* data) const; |
| + |
| // Returns a transform that will be used to change an event's location from |
| // the touchscreen's coordinate system into |display|'s coordinate system. |
| // The transform is also responsible for properly scaling the display if the |
| @@ -67,7 +86,8 @@ class DISPLAY_MANAGER_EXPORT TouchTransformController { |
| const ui::TouchscreenDevice& touch_device) const; |
| // For the provided |display| update the touch radius mapping. |
|
oshima
2017/05/19 23:54:00
nit: update the comment
sky
2017/05/21 14:42:41
Done.
|
| - void UpdateTouchRadius(const ManagedDisplayInfo& display) const; |
| + void UpdateTouchRadius(const ManagedDisplayInfo& display, |
| + UpdateData* update_data) const; |
| // For a given |target_display| and |target_display_id| update the touch |
| // transformation based on the touchscreen associated with |touch_display|. |
| @@ -79,7 +99,8 @@ class DISPLAY_MANAGER_EXPORT TouchTransformController { |
| // transformed. |
|
oshima
2017/05/19 23:54:00
ditto
sky
2017/05/21 14:42:41
Done.
|
| void UpdateTouchTransform(int64_t target_display_id, |
| const ManagedDisplayInfo& touch_display, |
| - const ManagedDisplayInfo& target_display) const; |
| + const ManagedDisplayInfo& target_display, |
| + UpdateData* update_data) const; |
| // Both |display_configurator_| and |display_manager_| are not owned and must |
| // outlive TouchTransformController. |
| @@ -88,6 +109,8 @@ class DISPLAY_MANAGER_EXPORT TouchTransformController { |
| bool is_calibrating_ = false; |
| + std::unique_ptr<TouchTransformSetter> setter_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(TouchTransformController); |
| }; |