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

Unified Diff: ash/touch/touch_transformer_controller.h

Issue 280833002: Re-land "Issue 191223007: Move touch CTM from X into Chrome" (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: adding missing file again Created 6 years, 7 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/shell.cc ('k') | ash/touch/touch_transformer_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/touch/touch_transformer_controller.h
diff --git a/ash/touch/touch_transformer_controller.h b/ash/touch/touch_transformer_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..f06be2957e1ac43faee9bdc74c15241fb01e4ca4
--- /dev/null
+++ b/ash/touch/touch_transformer_controller.h
@@ -0,0 +1,55 @@
+// Copyright 2014 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_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_
+#define ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_
+
+#include "ash/ash_export.h"
+#include "ash/display/display_controller.h"
+#include "ui/gfx/transform.h"
+
+namespace ash {
+
+// TouchTransformerController listens to display configuration change
+// and updates the touch transformation for touch displays.
+class ASH_EXPORT TouchTransformerController
+ : public DisplayController::Observer {
+ public:
+ TouchTransformerController();
+ virtual ~TouchTransformerController();
+
+ // Updates the TouchTransformer for touch device and pushes the new
+ // TouchTransformer into device manager.
+ void UpdateTouchTransformer() const;
+
+ // DisplayController::Observer:
+ virtual void OnDisplaysInitialized() OVERRIDE;
+ virtual void OnDisplayConfigurationChanged() OVERRIDE;
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
+ TouchTransformerMirrorModeLetterboxing);
+ FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
+ TouchTransformerMirrorModePillarboxing);
+ FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
+ TouchTransformerExtendedMode);
+
+ bool ShouldComputeMirrorModeTouchTransformer(
+ const DisplayInfo& touch_display) const ;
+
+ gfx::Transform GetMirrorModeTouchTransformer(
+ const DisplayInfo& touch_display) const;
+
+ gfx::Transform GetExtendedModeTouchTransformer(
+ const DisplayInfo& touch_display, const gfx::Size& fb_size) const;
+
+ // For unittests only.
+ bool force_compute_mirror_mode_touch_transformer_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchTransformerController);
+};
+
+} // namespace ash
+
+#endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_
« no previous file with comments | « ash/shell.cc ('k') | ash/touch/touch_transformer_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698