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

Unified Diff: ash/touch/touch_exploration_controller.h

Issue 240333007: wip: Second crack at implementing the touch exploration mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't extend DisplayController::Observer - TouchExplorationController is owned by the root window (… 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..2466ac941ea96bd893495ffd68dfa9f2a439f9cd
--- /dev/null
+++ b/ash/touch/touch_exploration_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_EXPLORATION_CONTROLLER_H_
+#define ASH_TOUCH_TOUCH_EXPLORATION_CONTROLLER_H_
+
+#include "ash/ash_export.h"
+#include "base/values.h"
+#include "ui/aura/window.h"
+#include "ui/events/event.h"
+#include "ui/events/event_rewriter.h"
+
+namespace ash {
+
+// TODO: How much screen/display logic (DisplayController::Observer,
Daniel Erat 2014/04/18 00:44:08 nit: please include your username in these TODOs (
+// 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()?
sadrul 2014/04/22 16:46:12 Depends on what you are trying to do. If you want
mfomitchev 2014/04/23 18:27:37 After thinking about this, I don't think I need to
+class ASH_EXPORT TouchExplorationController :
+ public ui::EventRewriter {
+ public:
+
Daniel Erat 2014/04/18 00:44:08 delete extra blank line
+ explicit TouchExplorationController(aura::Window* root_window);
+ virtual ~TouchExplorationController();
+
+ private:
+ //Overridden from ui::EventRewriter
Daniel Erat 2014/04/18 00:44:08 add a space after '//'
+ virtual ui::EventRewriteStatus RewriteEvent(
+ const ui::Event& event, scoped_ptr<ui::Event>* rewritten_event) OVERRIDE;
+ virtual ui::EventRewriteStatus NextDispatchEvent(
+ const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE;
+
+ ui::Event* CreateMouseMoveEvent(gfx::Point location, int flags);
Daniel Erat 2014/04/18 00:44:08 add a comment describing what this does
+
+ void EnterMouseMoveMode();
Daniel Erat 2014/04/18 00:44:08 add a comment
+
+ std::vector<int> touch_ids_;
+ // map of touch ids to their last know locations
Daniel Erat 2014/04/18 00:44:08 s/map/Map/, s/know/known/, add trailing period
+ std::map<int, gfx::Point> touch_locations_;
+
+ // Initialized from RewriteEvent() and dispatched in NextDispatchEvent().
+ scoped_ptr<ui::Event> next_dispatch_event_;
+
+ const int64 display_id_;
+ aura::Window* root_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchExplorationController);
+};
+
+} // namespace ash
+
+#endif // ASH_TOUCH_TOUCH_EXPLORATION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698