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> |
(...skipping 26 matching lines...) Expand all Loading... |
37 ~EventDispatcher() override; | 37 ~EventDispatcher() override; |
38 | 38 |
39 void set_root(ServerWindow* root) { root_ = root; } | 39 void set_root(ServerWindow* root) { root_ = root; } |
40 | 40 |
41 void set_surface_id(cc::SurfaceId surface_id) { surface_id_ = surface_id; } | 41 void set_surface_id(cc::SurfaceId surface_id) { surface_id_ = surface_id; } |
42 | 42 |
43 // |capture_window_| will receive all input. See window_tree.mojom for | 43 // |capture_window_| will receive all input. See window_tree.mojom for |
44 // details. | 44 // details. |
45 ServerWindow* capture_window() { return capture_window_; } | 45 ServerWindow* capture_window() { return capture_window_; } |
46 const ServerWindow* capture_window() const { return capture_window_; } | 46 const ServerWindow* capture_window() const { return capture_window_; } |
47 void SetCaptureWindow(ServerWindow* capture_window, bool in_nonclient_area); | 47 // Setting capture can fail if the window is blocked by a modal window |
| 48 // (indicated by returning |false|). |
| 49 bool SetCaptureWindow(ServerWindow* capture_window, bool in_nonclient_area); |
48 | 50 |
49 // Retrieves the ServerWindow of the last mouse move. | 51 // Retrieves the ServerWindow of the last mouse move. |
50 ServerWindow* mouse_cursor_source_window() const { | 52 ServerWindow* mouse_cursor_source_window() const { |
51 return mouse_cursor_source_window_; | 53 return mouse_cursor_source_window_; |
52 } | 54 } |
53 | 55 |
54 // Possibly updates the cursor. If we aren't in an implicit capture, we take | 56 // Possibly updates the cursor. If we aren't in an implicit capture, we take |
55 // the last known location of the mouse pointer, and look for the | 57 // the last known location of the mouse pointer, and look for the |
56 // ServerWindow* under it. | 58 // ServerWindow* under it. |
57 void UpdateCursorProviderByLastKnownLocation(); | 59 void UpdateCursorProviderByLastKnownLocation(); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // cancel or up. | 178 // cancel or up. |
177 PointerIdToTargetMap pointer_targets_; | 179 PointerIdToTargetMap pointer_targets_; |
178 | 180 |
179 DISALLOW_COPY_AND_ASSIGN(EventDispatcher); | 181 DISALLOW_COPY_AND_ASSIGN(EventDispatcher); |
180 }; | 182 }; |
181 | 183 |
182 } // namespace ws | 184 } // namespace ws |
183 } // namespace mus | 185 } // namespace mus |
184 | 186 |
185 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ | 187 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ |
OLD | NEW |