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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 void SetMousePointerScreenLocation(const gfx::Point& screen_location); | 51 void SetMousePointerScreenLocation(const gfx::Point& screen_location); |
52 const gfx::Point& mouse_pointer_last_location() const { | 52 const gfx::Point& mouse_pointer_last_location() const { |
53 return mouse_pointer_last_location_; | 53 return mouse_pointer_last_location_; |
54 } | 54 } |
55 | 55 |
56 // |capture_window_| will receive all input. See window_tree.mojom for | 56 // |capture_window_| will receive all input. See window_tree.mojom for |
57 // details. | 57 // details. |
58 ServerWindow* capture_window() { return capture_window_; } | 58 ServerWindow* capture_window() { return capture_window_; } |
59 const ServerWindow* capture_window() const { return capture_window_; } | 59 const ServerWindow* capture_window() const { return capture_window_; } |
60 void SetCaptureWindow(ServerWindow* capture_window, bool in_nonclient_area); | 60 // Setting capture can fail if the window is blocked by a modal window |
| 61 // (indicated by returning |false|). |
| 62 bool SetCaptureWindow(ServerWindow* capture_window, bool in_nonclient_area); |
61 | 63 |
62 // Retrieves the ServerWindow of the last mouse move. | 64 // Retrieves the ServerWindow of the last mouse move. |
63 ServerWindow* mouse_cursor_source_window() const { | 65 ServerWindow* mouse_cursor_source_window() const { |
64 return mouse_cursor_source_window_; | 66 return mouse_cursor_source_window_; |
65 } | 67 } |
66 | 68 |
67 // Possibly updates the cursor. If we aren't in an implicit capture, we take | 69 // Possibly updates the cursor. If we aren't in an implicit capture, we take |
68 // the last known location of the mouse pointer, and look for the | 70 // the last known location of the mouse pointer, and look for the |
69 // ServerWindow* under it. | 71 // ServerWindow* under it. |
70 void UpdateCursorProviderByLastKnownLocation(); | 72 void UpdateCursorProviderByLastKnownLocation(); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // cancel or up. | 191 // cancel or up. |
190 PointerIdToTargetMap pointer_targets_; | 192 PointerIdToTargetMap pointer_targets_; |
191 | 193 |
192 DISALLOW_COPY_AND_ASSIGN(EventDispatcher); | 194 DISALLOW_COPY_AND_ASSIGN(EventDispatcher); |
193 }; | 195 }; |
194 | 196 |
195 } // namespace ws | 197 } // namespace ws |
196 } // namespace mus | 198 } // namespace mus |
197 | 199 |
198 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ | 200 #endif // COMPONENTS_MUS_WS_EVENT_DISPATCHER_H_ |
OLD | NEW |