| 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 void RemoveFromKnown(const ServerWindow* window, | 331 void RemoveFromKnown(const ServerWindow* window, |
| 332 std::vector<ServerWindow*>* local_windows); | 332 std::vector<ServerWindow*>* local_windows); |
| 333 | 333 |
| 334 // Removes a root from set of roots of this tree. This does not remove | 334 // Removes a root from set of roots of this tree. This does not remove |
| 335 // the window from the window tree, only from the set of roots. | 335 // the window from the window tree, only from the set of roots. |
| 336 void RemoveRoot(ServerWindow* window, RemoveRootReason reason); | 336 void RemoveRoot(ServerWindow* window, RemoveRootReason reason); |
| 337 | 337 |
| 338 // Converts Window(s) to WindowData(s) for transport. This assumes all the | 338 // Converts Window(s) to WindowData(s) for transport. This assumes all the |
| 339 // windows are valid for the client. The parent of windows the client is not | 339 // windows are valid for the client. The parent of windows the client is not |
| 340 // allowed to see are set to NULL (in the returned WindowData(s)). | 340 // allowed to see are set to NULL (in the returned WindowData(s)). |
| 341 mojo::Array<mojom::WindowDataPtr> WindowsToWindowDatas( | 341 std::vector<mojom::WindowDataPtr> WindowsToWindowDatas( |
| 342 const std::vector<const ServerWindow*>& windows); | 342 const std::vector<const ServerWindow*>& windows); |
| 343 mojom::WindowDataPtr WindowToWindowData(const ServerWindow* window); | 343 mojom::WindowDataPtr WindowToWindowData(const ServerWindow* window); |
| 344 | 344 |
| 345 // Implementation of GetWindowTree(). Adds |window| to |windows| and recurses | 345 // Implementation of GetWindowTree(). Adds |window| to |windows| and recurses |
| 346 // if CanDescendIntoWindowForWindowTree() returns true. | 346 // if CanDescendIntoWindowForWindowTree() returns true. |
| 347 void GetWindowTreeImpl(const ServerWindow* window, | 347 void GetWindowTreeImpl(const ServerWindow* window, |
| 348 std::vector<const ServerWindow*>* windows) const; | 348 std::vector<const ServerWindow*>* windows) const; |
| 349 | 349 |
| 350 // Notify the client if the drawn state of any of the roots changes. | 350 // Notify the client if the drawn state of any of the roots changes. |
| 351 // |window| is the window that is changing to the drawn state | 351 // |window| is the window that is changing to the drawn state |
| (...skipping 17 matching lines...) Expand all Loading... |
| 369 // Returns true if the client has a pointer watcher and this event matches. | 369 // Returns true if the client has a pointer watcher and this event matches. |
| 370 bool EventMatchesPointerWatcher(const ui::Event& event) const; | 370 bool EventMatchesPointerWatcher(const ui::Event& event) const; |
| 371 | 371 |
| 372 // Calls OnChangeCompleted() on the client. | 372 // Calls OnChangeCompleted() on the client. |
| 373 void NotifyChangeCompleted(uint32_t change_id, | 373 void NotifyChangeCompleted(uint32_t change_id, |
| 374 mojom::WindowManagerErrorCode error_code); | 374 mojom::WindowManagerErrorCode error_code); |
| 375 | 375 |
| 376 // WindowTree: | 376 // WindowTree: |
| 377 void NewWindow(uint32_t change_id, | 377 void NewWindow(uint32_t change_id, |
| 378 Id transport_window_id, | 378 Id transport_window_id, |
| 379 mojo::Map<mojo::String, mojo::Array<uint8_t>> | 379 const base::Optional< |
| 380 std::unordered_map<std::string, std::vector<uint8_t>>>& |
| 380 transport_properties) override; | 381 transport_properties) override; |
| 381 void NewTopLevelWindow(uint32_t change_id, | 382 void NewTopLevelWindow( |
| 382 Id transport_window_id, | 383 uint32_t change_id, |
| 383 mojo::Map<mojo::String, mojo::Array<uint8_t>> | 384 Id transport_window_id, |
| 384 transport_properties) override; | 385 const std::unordered_map<std::string, std::vector<uint8_t>>& |
| 386 transport_properties) override; |
| 385 void DeleteWindow(uint32_t change_id, Id transport_window_id) override; | 387 void DeleteWindow(uint32_t change_id, Id transport_window_id) override; |
| 386 void AddWindow(uint32_t change_id, Id parent_id, Id child_id) override; | 388 void AddWindow(uint32_t change_id, Id parent_id, Id child_id) override; |
| 387 void RemoveWindowFromParent(uint32_t change_id, Id window_id) override; | 389 void RemoveWindowFromParent(uint32_t change_id, Id window_id) override; |
| 388 void AddTransientWindow(uint32_t change_id, | 390 void AddTransientWindow(uint32_t change_id, |
| 389 Id window, | 391 Id window, |
| 390 Id transient_window) override; | 392 Id transient_window) override; |
| 391 void RemoveTransientWindowFromParent(uint32_t change_id, | 393 void RemoveTransientWindowFromParent(uint32_t change_id, |
| 392 Id transient_window_id) override; | 394 Id transient_window_id) override; |
| 393 void SetModal(uint32_t change_id, Id window_id) override; | 395 void SetModal(uint32_t change_id, Id window_id) override; |
| 394 void ReorderWindow(uint32_t change_Id, | 396 void ReorderWindow(uint32_t change_Id, |
| 395 Id window_id, | 397 Id window_id, |
| 396 Id relative_window_id, | 398 Id relative_window_id, |
| 397 mojom::OrderDirection direction) override; | 399 mojom::OrderDirection direction) override; |
| 398 void GetWindowTree( | 400 void GetWindowTree( |
| 399 Id window_id, | 401 Id window_id, |
| 400 const base::Callback<void(mojo::Array<mojom::WindowDataPtr>)>& callback) | 402 const base::Callback<void(std::vector<mojom::WindowDataPtr>)>& callback) |
| 401 override; | 403 override; |
| 402 void SetCapture(uint32_t change_id, Id window_id) override; | 404 void SetCapture(uint32_t change_id, Id window_id) override; |
| 403 void ReleaseCapture(uint32_t change_id, Id window_id) override; | 405 void ReleaseCapture(uint32_t change_id, Id window_id) override; |
| 404 void StartPointerWatcher(bool want_moves) override; | 406 void StartPointerWatcher(bool want_moves) override; |
| 405 void StopPointerWatcher() override; | 407 void StopPointerWatcher() override; |
| 406 void SetWindowBounds(uint32_t change_id, | 408 void SetWindowBounds(uint32_t change_id, |
| 407 Id window_id, | 409 Id window_id, |
| 408 const gfx::Rect& bounds) override; | 410 const gfx::Rect& bounds) override; |
| 409 void SetWindowVisibility(uint32_t change_id, | 411 void SetWindowVisibility(uint32_t change_id, |
| 410 Id window_id, | 412 Id window_id, |
| 411 bool visible) override; | 413 bool visible) override; |
| 412 void SetWindowProperty(uint32_t change_id, | 414 void SetWindowProperty( |
| 413 Id transport_window_id, | 415 uint32_t change_id, |
| 414 const mojo::String& name, | 416 Id transport_window_id, |
| 415 mojo::Array<uint8_t> value) override; | 417 const std::string& name, |
| 418 const base::Optional<std::vector<uint8_t>>& value) override; |
| 416 void SetWindowOpacity(uint32_t change_id, | 419 void SetWindowOpacity(uint32_t change_id, |
| 417 Id window_id, | 420 Id window_id, |
| 418 float opacity) override; | 421 float opacity) override; |
| 419 void AttachCompositorFrameSink( | 422 void AttachCompositorFrameSink( |
| 420 Id transport_window_id, | 423 Id transport_window_id, |
| 421 mojom::CompositorFrameSinkType type, | 424 mojom::CompositorFrameSinkType type, |
| 422 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink, | 425 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink, |
| 423 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; | 426 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; |
| 424 void Embed(Id transport_window_id, | 427 void Embed(Id transport_window_id, |
| 425 mojom::WindowTreeClientPtr client, | 428 mojom::WindowTreeClientPtr client, |
| 426 uint32_t flags, | 429 uint32_t flags, |
| 427 const EmbedCallback& callback) override; | 430 const EmbedCallback& callback) override; |
| 428 void SetFocus(uint32_t change_id, Id transport_window_id) override; | 431 void SetFocus(uint32_t change_id, Id transport_window_id) override; |
| 429 void SetCanFocus(Id transport_window_id, bool can_focus) override; | 432 void SetCanFocus(Id transport_window_id, bool can_focus) override; |
| 430 void SetCanAcceptEvents(Id transport_window_id, | 433 void SetCanAcceptEvents(Id transport_window_id, |
| 431 bool can_accept_events) override; | 434 bool can_accept_events) override; |
| 432 void SetPredefinedCursor(uint32_t change_id, | 435 void SetPredefinedCursor(uint32_t change_id, |
| 433 Id transport_window_id, | 436 Id transport_window_id, |
| 434 ui::mojom::Cursor cursor_id) override; | 437 ui::mojom::Cursor cursor_id) override; |
| 435 void SetWindowTextInputState(Id transport_window_id, | 438 void SetWindowTextInputState(Id transport_window_id, |
| 436 mojo::TextInputStatePtr state) override; | 439 mojo::TextInputStatePtr state) override; |
| 437 void SetImeVisibility(Id transport_window_id, | 440 void SetImeVisibility(Id transport_window_id, |
| 438 bool visible, | 441 bool visible, |
| 439 mojo::TextInputStatePtr state) override; | 442 mojo::TextInputStatePtr state) override; |
| 440 void OnWindowInputEventAck(uint32_t event_id, | 443 void OnWindowInputEventAck(uint32_t event_id, |
| 441 mojom::EventResult result) override; | 444 mojom::EventResult result) override; |
| 442 void SetClientArea( | 445 void SetClientArea(Id transport_window_id, |
| 443 Id transport_window_id, | 446 const gfx::Insets& insets, |
| 444 const gfx::Insets& insets, | 447 const base::Optional<std::vector<gfx::Rect>>& |
| 445 mojo::Array<gfx::Rect> transport_additional_client_areas) override; | 448 transport_additional_client_areas) override; |
| 446 void SetCanAcceptDrops(Id window_id, bool accepts_drops) override; | 449 void SetCanAcceptDrops(Id window_id, bool accepts_drops) override; |
| 447 void SetHitTestMask(Id transport_window_id, | 450 void SetHitTestMask(Id transport_window_id, |
| 448 const base::Optional<gfx::Rect>& mask) override; | 451 const base::Optional<gfx::Rect>& mask) override; |
| 449 void GetWindowManagerClient( | 452 void GetWindowManagerClient( |
| 450 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) | 453 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) |
| 451 override; | 454 override; |
| 452 void GetCursorLocationMemory(const GetCursorLocationMemoryCallback& callback) | 455 void GetCursorLocationMemory(const GetCursorLocationMemoryCallback& callback) |
| 453 override; | 456 override; |
| 454 void PerformDragDrop(uint32_t change_id, | 457 void PerformDragDrop( |
| 455 Id source_window_id, | 458 uint32_t change_id, |
| 456 mojo::Map<mojo::String, mojo::Array<uint8_t>> drag_data, | 459 Id source_window_id, |
| 457 uint32_t drag_operation) override; | 460 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, |
| 461 uint32_t drag_operation) override; |
| 458 void CancelDragDrop(Id window_id) override; | 462 void CancelDragDrop(Id window_id) override; |
| 459 void PerformWindowMove(uint32_t change_id, | 463 void PerformWindowMove(uint32_t change_id, |
| 460 Id window_id, | 464 Id window_id, |
| 461 ui::mojom::MoveLoopSource source, | 465 ui::mojom::MoveLoopSource source, |
| 462 const gfx::Point& cursor) override; | 466 const gfx::Point& cursor) override; |
| 463 void CancelWindowMove(Id window_id) override; | 467 void CancelWindowMove(Id window_id) override; |
| 464 | 468 |
| 465 // mojom::WindowManagerClient: | 469 // mojom::WindowManagerClient: |
| 466 void AddAccelerator(uint32_t id, | 470 void AddAccelerator(uint32_t id, |
| 467 mojom::EventMatcherPtr event_matcher, | 471 mojom::EventMatcherPtr event_matcher, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 waiting_for_top_level_window_info_; | 581 waiting_for_top_level_window_info_; |
| 578 bool embedder_intercepts_events_ = false; | 582 bool embedder_intercepts_events_ = false; |
| 579 | 583 |
| 580 DISALLOW_COPY_AND_ASSIGN(WindowTree); | 584 DISALLOW_COPY_AND_ASSIGN(WindowTree); |
| 581 }; | 585 }; |
| 582 | 586 |
| 583 } // namespace ws | 587 } // namespace ws |
| 584 } // namespace ui | 588 } // namespace ui |
| 585 | 589 |
| 586 #endif // SERVICES_UI_WS_WINDOW_TREE_H_ | 590 #endif // SERVICES_UI_WS_WINDOW_TREE_H_ |
| OLD | NEW |