| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ | 5 #ifndef COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ |
| 6 #define COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ | 6 #define COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
| 11 | 12 |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "cc/surfaces/surface_id.h" | 14 #include "cc/surfaces/surface_id.h" |
| 15 #include "components/mus/public/interfaces/input_event_matcher.mojom.h" | 15 #include "components/mus/public/interfaces/input_event_matcher.mojom.h" |
| 16 #include "components/mus/ws/server_window_observer.h" | 16 #include "components/mus/ws/server_window_observer.h" |
| 17 #include "ui/gfx/geometry/rect_f.h" | 17 #include "ui/gfx/geometry/rect_f.h" |
| 18 | 18 |
| 19 namespace ui { | 19 namespace ui { |
| 20 class Event; | 20 class Event; |
| 21 class KeyEvent; | 21 class KeyEvent; |
| 22 class LocatedEvent; | 22 class LocatedEvent; |
| 23 } | 23 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 bool capture_window_in_nonclient_area_; | 171 bool capture_window_in_nonclient_area_; |
| 172 bool mouse_button_down_; | 172 bool mouse_button_down_; |
| 173 ServerWindow* mouse_cursor_source_window_; | 173 ServerWindow* mouse_cursor_source_window_; |
| 174 | 174 |
| 175 // The on screen location of the mouse pointer. This can be outside the | 175 // The on screen location of the mouse pointer. This can be outside the |
| 176 // bounds of |mouse_cursor_source_window_|, which can capture the cursor. | 176 // bounds of |mouse_cursor_source_window_|, which can capture the cursor. |
| 177 gfx::Point mouse_pointer_last_location_; | 177 gfx::Point mouse_pointer_last_location_; |
| 178 | 178 |
| 179 cc::SurfaceId surface_id_; | 179 cc::SurfaceId surface_id_; |
| 180 | 180 |
| 181 using Entry = std::pair<uint32_t, scoped_ptr<Accelerator>>; | 181 using Entry = std::pair<uint32_t, std::unique_ptr<Accelerator>>; |
| 182 std::map<uint32_t, scoped_ptr<Accelerator>> accelerators_; | 182 std::map<uint32_t, std::unique_ptr<Accelerator>> accelerators_; |
| 183 | 183 |
| 184 using PointerIdToTargetMap = std::map<int32_t, PointerTarget>; | 184 using PointerIdToTargetMap = std::map<int32_t, PointerTarget>; |
| 185 // |pointer_targets_| contains the active pointers. For a mouse based pointer | 185 // |pointer_targets_| contains the active pointers. For a mouse based pointer |
| 186 // a PointerTarget is always active (and present in |pointer_targets_|). For | 186 // a PointerTarget is always active (and present in |pointer_targets_|). For |
| 187 // touch based pointers the pointer is active while down and removed on | 187 // touch based pointers the pointer is active while down and removed on |
| 188 // cancel or up. | 188 // cancel or up. |
| 189 PointerIdToTargetMap pointer_targets_; | 189 PointerIdToTargetMap pointer_targets_; |
| 190 | 190 |
| 191 DISALLOW_COPY_AND_ASSIGN(EventDispatcher); | 191 DISALLOW_COPY_AND_ASSIGN(EventDispatcher); |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 } // namespace ws | 194 } // namespace ws |
| 195 } // namespace mus | 195 } // namespace mus |
| 196 | 196 |
| 197 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ | 197 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ |
| OLD | NEW |