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

Unified Diff: ash/touch/touch_exploration_controller.h

Issue 225143007: First crack at implementing the touch explaration mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor changes Created 6 years, 8 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
Index: ash/touch/touch_exploration_controller.h
diff --git a/ash/touch/touch_exploration_controller.h b/ash/touch/touch_exploration_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3405400651ab6ea3d92981c89c45d4ee475acfc
--- /dev/null
+++ b/ash/touch/touch_exploration_controller.h
@@ -0,0 +1,57 @@
+// 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_EXPLORATION_CONTROLLER_H_
+#define ASH_TOUCH_TOUCH_EXPLORATION_CONTROLLER_H_
+
+#include "ash/ash_export.h"
+#include "ash/display/display_controller.h"
+#include "base/values.h"
+#include "ui/aura/window.h"
+#include "ui/events/event.h"
+#include "ui/events/event_handler.h"
+
+namespace ash {
+namespace internal {
+
+// TODO: How much screen/display logic (DisplayController::Observer,
mfomitchev 2014/04/11 21:00:58 Bunch of questions in TODOs here.
sadrul 2014/04/14 20:22:11 Unsure. oshima@/dnicoara@ would have good answers.
+// gfx::DisplayObserver, etc) do we need here? This is managed from
+// RootWindowCOntroller
+// TODO: Maybe implement gfx::DisplayObserver
+// TODO: Do we need to inherit from OutputConfigurator::Observer to react to
+// OnDisplayModeChanged()?
+class ASH_EXPORT TouchExplorationController :
+ public ui::EventHandler,
+ public DisplayController::Observer {
+ public:
+
+ explicit TouchExplorationController(aura::Window* root_window);
+ virtual ~TouchExplorationController();
+
+ private:
+ // Overriden from ui::EventHandler.
+ virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
+
+ // Overriden form DisplayController::Observer.
+ virtual void OnDisplaysInitialized() OVERRIDE;
+ virtual void OnDisplayConfigurationChanging() OVERRIDE;
+ virtual void OnDisplayConfigurationChanged() OVERRIDE;
+
+ void GenerateMouseEvent(
+ ui::EventType event_type, gfx::Point location, int flags);
+
+ std::vector<int> touch_ids_;
+ // map of touch ids to their last know locations
+ std::map<int, gfx::Point> touch_locations_;
+
+ const int64 display_id_;
+ aura::Window* root_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchExplorationController);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_TOUCH_TOUCH_EXPLORATION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698