| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_ | 5 #ifndef ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_ |
| 6 #define ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_ | 6 #define ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "ui/events/event_handler.h" | 11 #include "ui/events/event_handler.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 | 14 |
| 15 // An event filter that transforms input event properties in extended desktop | 15 // An event filter that transforms input event properties in extended desktop |
| 16 // environment. | 16 // environment. |
| 17 class ASH_EXPORT EventTransformationHandler : public ui::EventHandler { | 17 class ASH_EXPORT EventTransformationHandler : public ui::EventHandler { |
| 18 public: | 18 public: |
| 19 enum TransformationMode { | 19 enum TransformationMode { |
| 20 TRANSFORM_AUTO, // Transform events by the default amount. | 20 TRANSFORM_AUTO, // Transform events by the default amount. |
| 21 // 1. Linear scaling w.r.t. the device scale factor. | 21 // 1. Linear scaling w.r.t. the device scale factor. |
| 22 // 2. Add 20% more for non-integrated displays. | 22 // 2. Add 20% more for non-integrated displays. |
| 23 TRANSFORM_NONE, // No transformation. | 23 TRANSFORM_NONE, // No transformation. |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 EventTransformationHandler(); | 26 EventTransformationHandler(); |
| 27 ~EventTransformationHandler() override; | 27 ~EventTransformationHandler() override; |
| 28 | 28 |
| 29 void set_transformation_mode(TransformationMode transformation_mode) { | 29 void set_transformation_mode(TransformationMode transformation_mode) { |
| 30 transformation_mode_ = transformation_mode; | 30 transformation_mode_ = transformation_mode; |
| 31 } | 31 } |
| 32 | 32 |
| 33 // Overridden from ui::EventHandler. | 33 // Overridden from ui::EventHandler. |
| 34 void OnScrollEvent(ui::ScrollEvent* event) override; | 34 void OnScrollEvent(ui::ScrollEvent* event) override; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 TransformationMode transformation_mode_; | 37 TransformationMode transformation_mode_; |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(EventTransformationHandler); | 39 DISALLOW_COPY_AND_ASSIGN(EventTransformationHandler); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace ash | 42 } // namespace ash |
| 43 | 43 |
| 44 #endif // ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_ | 44 #endif // ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_ |
| OLD | NEW |