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

Unified Diff: ash/display/event_transformation_handler.h

Issue 11743013: Scaling scroll/fling events in multi-monitor setup (Closed) Base URL: https://chromium.googlesource.com/chromium/src@git-svn
Patch Set: Addressing Ben's comment Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/display/event_transformation_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/event_transformation_handler.h
diff --git a/ash/display/event_transformation_handler.h b/ash/display/event_transformation_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..9cf0add78c9c85309ae0279e523cd089c128d969
--- /dev/null
+++ b/ash/display/event_transformation_handler.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_
+#define ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_
+
+#include "ash/ash_export.h"
+#include "base/compiler_specific.h"
+#include "ui/base/events/event_handler.h"
+
+namespace ash {
+
+namespace internal {
+
+// An event filter that transforms input event properties in extended desktop
+// environment. It currently handles only ScrollEvents.
+class ASH_EXPORT EventTransformationHandler : public ui::EventHandler {
+ public:
+ enum TransformationMode {
+ TRANSFORM_AUTO, // Transform events by the default amount.
+ // 1. Linear scaling w.r.t. the device scale factor.
+ // 2. Add 20% more for non-integrated displays.
+ TRANSFORM_NONE, // No transformation.
+ };
+
+ EventTransformationHandler();
+ virtual ~EventTransformationHandler();
+
+ void set_transformation_mode(TransformationMode transformation_mode) {
+ transformation_mode_ = transformation_mode;
+ }
+
+ // Overridden from ui::EventHandler.
+ virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
+
+ private:
+ TransformationMode transformation_mode_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventTransformationHandler);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_DISPLAY_EVENT_TRANSFORMATION_HANDLER_H_
+
« no previous file with comments | « ash/ash.gyp ('k') | ash/display/event_transformation_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698