OLD | NEW |
(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 ASH_TOUCH_TOUCH_EXPLORATION_CONTROLLER_H_ |
| 6 #define ASH_TOUCH_TOUCH_EXPLORATION_CONTROLLER_H_ |
| 7 |
| 8 #include "ash/ash_export.h" |
| 9 #include "ash/display/display_controller.h" |
| 10 #include "base/values.h" |
| 11 #include "ui/aura/window.h" |
| 12 #include "ui/events/event.h" |
| 13 #include "ui/events/event_rewriter.h" |
| 14 |
| 15 namespace ash { |
| 16 |
| 17 // TODO: How much screen/display logic (DisplayController::Observer, |
| 18 // gfx::DisplayObserver, etc) do we need here? This is managed from |
| 19 // RootWindowCOntroller |
| 20 // TODO: Maybe implement gfx::DisplayObserver |
| 21 // TODO: Do we need to inherit from OutputConfigurator::Observer to react to |
| 22 // OnDisplayModeChanged()? |
| 23 class ASH_EXPORT TouchExplorationController : |
| 24 public ui::EventRewriter, |
| 25 public DisplayController::Observer { |
| 26 public: |
| 27 |
| 28 explicit TouchExplorationController(aura::Window* root_window); |
| 29 virtual ~TouchExplorationController(); |
| 30 |
| 31 private: |
| 32 //Overridden from ui::EventRewriter |
| 33 virtual ui::EventRewriteStatus RewriteEvent( |
| 34 const ui::Event& event, scoped_ptr<ui::Event>* rewritten_event) OVERRIDE; |
| 35 virtual ui::EventRewriteStatus NextDispatchEvent( |
| 36 const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE; |
| 37 |
| 38 // Overridden form DisplayController::Observer. |
| 39 virtual void OnDisplaysInitialized() OVERRIDE; |
| 40 virtual void OnDisplayConfigurationChanging() OVERRIDE; |
| 41 virtual void OnDisplayConfigurationChanged() OVERRIDE; |
| 42 |
| 43 ui::Event* CreateMouseMoveEvent(gfx::Point location, int flags); |
| 44 |
| 45 std::vector<int> touch_ids_; |
| 46 // map of touch ids to their last know locations |
| 47 std::map<int, gfx::Point> touch_locations_; |
| 48 |
| 49 // Initialized from RewriteEvent() and dispatched in NextDispatchEvent(). |
| 50 scoped_ptr<ui::Event> next_dispatch_event_; |
| 51 |
| 52 const int64 display_id_; |
| 53 aura::Window* root_window_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); |
| 56 }; |
| 57 |
| 58 } // namespace ash |
| 59 |
| 60 #endif // ASH_TOUCH_TOUCH_EXPLORATION_CONTROLLER_H_ |
OLD | NEW |