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
3 // found in the LICENSE file.
5 #ifndef ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_
6 #define ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_
8 #include "ash/ash_export.h"
9 #include "base/compiler_specific.h"
10 #include "ui/events/event_handler.h"
14 // An event filter that transforms input event properties in extended desktop
16 class ASH_EXPORT EventTransformationHandler
: public ui::EventHandler
{
18 enum TransformationMode
{
19 TRANSFORM_AUTO
, // Transform events by the default amount.
20 // 1. Linear scaling w.r.t. the device scale factor.
21 // 2. Add 20% more for non-integrated displays.
22 TRANSFORM_NONE
, // No transformation.
25 EventTransformationHandler();
26 virtual ~EventTransformationHandler();
28 void set_transformation_mode(TransformationMode transformation_mode
) {
29 transformation_mode_
= transformation_mode
;
32 // Overridden from ui::EventHandler.
33 virtual void OnScrollEvent(ui::ScrollEvent
* event
) OVERRIDE
;
36 TransformationMode transformation_mode_
;
38 DISALLOW_COPY_AND_ASSIGN(EventTransformationHandler
);
43 #endif // ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_