OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 SERVICES_UI_WS_WINDOW_TREE_H_ | 5 #ifndef SERVICES_UI_WS_WINDOW_TREE_H_ |
6 #define SERVICES_UI_WS_WINDOW_TREE_H_ | 6 #define SERVICES_UI_WS_WINDOW_TREE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 void DispatchInputEvent(ServerWindow* target, const ui::Event& event); | 173 void DispatchInputEvent(ServerWindow* target, const ui::Event& event); |
174 | 174 |
175 bool IsWaitingForNewTopLevelWindow(uint32_t wm_change_id); | 175 bool IsWaitingForNewTopLevelWindow(uint32_t wm_change_id); |
176 void OnWindowManagerCreatedTopLevelWindow(uint32_t wm_change_id, | 176 void OnWindowManagerCreatedTopLevelWindow(uint32_t wm_change_id, |
177 uint32_t client_change_id, | 177 uint32_t client_change_id, |
178 const ServerWindow* window); | 178 const ServerWindow* window); |
179 void AddActivationParent(const ClientWindowId& window_id); | 179 void AddActivationParent(const ClientWindowId& window_id); |
180 | 180 |
181 // Calls through to the client. | 181 // Calls through to the client. |
182 void OnChangeCompleted(uint32_t change_id, bool success); | 182 void OnChangeCompleted(uint32_t change_id, bool success); |
183 void OnAccelerator(uint32_t accelerator_id, const ui::Event& event); | 183 // |state_to_ack| is the WindowManagerState to call through to when the ack |
| 184 // from the accelerator is received. If |needs_ack| is true an ack is |
| 185 // required. |
| 186 void OnAccelerator(uint32_t accelerator_id, |
| 187 const ui::Event& event, |
| 188 bool needs_ack); |
184 | 189 |
185 // Called when |tree|'s jankiness changes (see janky_ for definition). | 190 // Called when |tree|'s jankiness changes (see janky_ for definition). |
186 // Notifies the window manager client so it can update UI for the affected | 191 // Notifies the window manager client so it can update UI for the affected |
187 // window(s). | 192 // window(s). |
188 void ClientJankinessChanged(WindowTree* tree); | 193 void ClientJankinessChanged(WindowTree* tree); |
189 | 194 |
190 // The following methods are invoked after the corresponding change has been | 195 // The following methods are invoked after the corresponding change has been |
191 // processed. They do the appropriate bookkeeping and update the client as | 196 // processed. They do the appropriate bookkeeping and update the client as |
192 // necessary. | 197 // necessary. |
193 void ProcessWindowBoundsChanged(const ServerWindow* window, | 198 void ProcessWindowBoundsChanged(const ServerWindow* window, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 void NotifyDrawnStateChanged(const ServerWindow* window, | 324 void NotifyDrawnStateChanged(const ServerWindow* window, |
320 bool new_drawn_value); | 325 bool new_drawn_value); |
321 | 326 |
322 // Deletes all Windows we own. | 327 // Deletes all Windows we own. |
323 void DestroyWindows(); | 328 void DestroyWindows(); |
324 | 329 |
325 bool CanEmbed(const ClientWindowId& window_id) const; | 330 bool CanEmbed(const ClientWindowId& window_id) const; |
326 void PrepareForEmbed(ServerWindow* window); | 331 void PrepareForEmbed(ServerWindow* window); |
327 void RemoveChildrenAsPartOfEmbed(ServerWindow* window); | 332 void RemoveChildrenAsPartOfEmbed(ServerWindow* window); |
328 | 333 |
| 334 // Generates a new event id for an accelerator or event ack, sets it in |
| 335 // |event_ack_id_| and returns it. |
| 336 uint32_t GenerateEventAckId(); |
| 337 |
329 void DispatchInputEventImpl(ServerWindow* target, const ui::Event& event); | 338 void DispatchInputEventImpl(ServerWindow* target, const ui::Event& event); |
330 | 339 |
331 // Calls OnChangeCompleted() on the client. | 340 // Calls OnChangeCompleted() on the client. |
332 void NotifyChangeCompleted(uint32_t change_id, | 341 void NotifyChangeCompleted(uint32_t change_id, |
333 mojom::WindowManagerErrorCode error_code); | 342 mojom::WindowManagerErrorCode error_code); |
334 | 343 |
335 // WindowTree: | 344 // WindowTree: |
336 void NewWindow(uint32_t change_id, | 345 void NewWindow(uint32_t change_id, |
337 Id transport_window_id, | 346 Id transport_window_id, |
338 mojo::Map<mojo::String, mojo::Array<uint8_t>> | 347 mojo::Map<mojo::String, mojo::Array<uint8_t>> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 int32_t y_offset, | 434 int32_t y_offset, |
426 const gfx::Insets& hit_area) override; | 435 const gfx::Insets& hit_area) override; |
427 void WmResponse(uint32_t change_id, bool response) override; | 436 void WmResponse(uint32_t change_id, bool response) override; |
428 void WmRequestClose(Id transport_window_id) override; | 437 void WmRequestClose(Id transport_window_id) override; |
429 void WmSetFrameDecorationValues( | 438 void WmSetFrameDecorationValues( |
430 mojom::FrameDecorationValuesPtr values) override; | 439 mojom::FrameDecorationValuesPtr values) override; |
431 void WmSetNonClientCursor(uint32_t window_id, | 440 void WmSetNonClientCursor(uint32_t window_id, |
432 mojom::Cursor cursor_id) override; | 441 mojom::Cursor cursor_id) override; |
433 void OnWmCreatedTopLevelWindow(uint32_t change_id, | 442 void OnWmCreatedTopLevelWindow(uint32_t change_id, |
434 Id transport_window_id) override; | 443 Id transport_window_id) override; |
| 444 void OnAcceleratorAck(uint32_t event_id, mojom::EventResult result) override; |
435 | 445 |
436 // AccessPolicyDelegate: | 446 // AccessPolicyDelegate: |
437 bool HasRootForAccessPolicy(const ServerWindow* window) const override; | 447 bool HasRootForAccessPolicy(const ServerWindow* window) const override; |
438 bool IsWindowKnownForAccessPolicy(const ServerWindow* window) const override; | 448 bool IsWindowKnownForAccessPolicy(const ServerWindow* window) const override; |
439 bool IsWindowRootOfAnotherTreeForAccessPolicy( | 449 bool IsWindowRootOfAnotherTreeForAccessPolicy( |
440 const ServerWindow* window) const override; | 450 const ServerWindow* window) const override; |
441 | 451 |
442 WindowServer* window_server_; | 452 WindowServer* window_server_; |
443 | 453 |
444 UserId user_id_; | 454 UserId user_id_; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 waiting_for_top_level_window_info_; | 503 waiting_for_top_level_window_info_; |
494 bool embedder_intercepts_events_ = false; | 504 bool embedder_intercepts_events_ = false; |
495 | 505 |
496 DISALLOW_COPY_AND_ASSIGN(WindowTree); | 506 DISALLOW_COPY_AND_ASSIGN(WindowTree); |
497 }; | 507 }; |
498 | 508 |
499 } // namespace ws | 509 } // namespace ws |
500 } // namespace ui | 510 } // namespace ui |
501 | 511 |
502 #endif // SERVICES_UI_WS_WINDOW_TREE_H_ | 512 #endif // SERVICES_UI_WS_WINDOW_TREE_H_ |
OLD | NEW |