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

Side by Side Diff: ui/chromeos/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: Adding a flag to disable the touch exploration mode. 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 unified diff | Download patch
« no previous file with comments | « ui/chromeos/DEPS ('k') | ui/chromeos/touch_exploration_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #ifndef UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_
6 #define UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_
7
8 #include "base/values.h"
9 #include "ui/chromeos/ui_chromeos_export.h"
10 #include "ui/events/event_rewriter.h"
11 #include "ui/gfx/geometry/point.h"
12
13 namespace aura {
14 class Window;
15 }
16
17 namespace ui {
18
19 class Event;
20
21 // TouchExplorationController is used in tandem with "Spoken Feedback" to
22 // make the touch UI accessible. TouchExplorationController rewrites the
23 // incoming touch events as follows:
24 // - When one finger is touching the screen, touch events are converted to mouse
25 // moves. This is the "Touch Exploration Mode". (The idea is that mouse moves
26 // will be subsequently used by another component to move focus between UI
27 // elements, and the elements will be read out to the user.)
28 // - When more than one finger is touching the screen, touches from the
29 // first (i.e. "oldest") finger are ignored, and the other touches go through
30 // as is.
31 class UI_CHROMEOS_EXPORT TouchExplorationController :
32 public ui::EventRewriter {
33 public:
34 explicit TouchExplorationController(aura::Window* root_window);
35 virtual ~TouchExplorationController();
36
37 private:
38 // Overridden from ui::EventRewriter
39 virtual ui::EventRewriteStatus RewriteEvent(
40 const ui::Event& event, scoped_ptr<ui::Event>* rewritten_event) OVERRIDE;
41 virtual ui::EventRewriteStatus NextDispatchEvent(
42 const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE;
43
44 ui::Event* CreateMouseMoveEvent(gfx::Point location, int flags);
45
46 void EnterTouchToMouseMode();
47
48 // A set of touch ids for fingers currently touching the screen.
49 std::vector<int> touch_ids_;
50
51 // Map of touch ids to their last known location.
52 std::map<int, gfx::Point> touch_locations_;
53
54 // Initialized from RewriteEvent() and dispatched in NextDispatchEvent().
55 scoped_ptr<ui::Event> next_dispatch_event_;
56
57 aura::Window* root_window_;
58
59 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController);
60 };
61
62 } // namespace ui
63
64 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ui/chromeos/DEPS ('k') | ui/chromeos/touch_exploration_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698