| 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 #include "ui/aura/mus/window_tree_client.h" | 5 #include "ui/aura/mus/window_tree_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 int64_t display_id) { | 354 int64_t display_id) { |
| 355 std::unique_ptr<WindowPortMus> window_port = | 355 std::unique_ptr<WindowPortMus> window_port = |
| 356 CreateWindowPortMus(window_data, window_mus_type); | 356 CreateWindowPortMus(window_data, window_mus_type); |
| 357 roots_.insert(window_port.get()); | 357 roots_.insert(window_port.get()); |
| 358 std::unique_ptr<WindowTreeHostMus> window_tree_host = | 358 std::unique_ptr<WindowTreeHostMus> window_tree_host = |
| 359 base::MakeUnique<WindowTreeHostMus>(std::move(window_port), this, | 359 base::MakeUnique<WindowTreeHostMus>(std::move(window_port), this, |
| 360 display_id); | 360 display_id); |
| 361 if (!window_data.is_null()) { | 361 if (!window_data.is_null()) { |
| 362 SetLocalPropertiesFromServerProperties( | 362 SetLocalPropertiesFromServerProperties( |
| 363 WindowMus::Get(window_tree_host->window()), window_data); | 363 WindowMus::Get(window_tree_host->window()), window_data); |
| 364 if (window_data->visible) { |
| 365 SetWindowVisibleFromServer(WindowMus::Get(window_tree_host->window()), |
| 366 true); |
| 367 } |
| 368 SetWindowBoundsFromServer(WindowMus::Get(window_tree_host->window()), |
| 369 window_data->bounds); |
| 364 } | 370 } |
| 365 return window_tree_host; | 371 return window_tree_host; |
| 366 } | 372 } |
| 367 | 373 |
| 368 WindowMus* WindowTreeClient::NewWindowFromWindowData( | 374 WindowMus* WindowTreeClient::NewWindowFromWindowData( |
| 369 WindowMus* parent, | 375 WindowMus* parent, |
| 370 const ui::mojom::WindowDataPtr& window_data) { | 376 const ui::mojom::WindowDataPtr& window_data) { |
| 371 // This function is only called for windows coming from other clients. | 377 // This function is only called for windows coming from other clients. |
| 372 std::unique_ptr<WindowPortMus> window_port_mus( | 378 std::unique_ptr<WindowPortMus> window_port_mus( |
| 373 CreateWindowPortMus(window_data, WindowMusType::OTHER)); | 379 CreateWindowPortMus(window_data, WindowMusType::OTHER)); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 DCHECK(roots_.empty()); | 455 DCHECK(roots_.empty()); |
| 450 std::unique_ptr<WindowTreeHostMus> window_tree_host = | 456 std::unique_ptr<WindowTreeHostMus> window_tree_host = |
| 451 CreateWindowTreeHost(WindowMusType::EMBED, root_data, display_id); | 457 CreateWindowTreeHost(WindowMusType::EMBED, root_data, display_id); |
| 452 | 458 |
| 453 focus_synchronizer_->SetFocusFromServer( | 459 focus_synchronizer_->SetFocusFromServer( |
| 454 GetWindowByServerId(focused_window_id)); | 460 GetWindowByServerId(focused_window_id)); |
| 455 | 461 |
| 456 delegate_->OnEmbed(std::move(window_tree_host)); | 462 delegate_->OnEmbed(std::move(window_tree_host)); |
| 457 } | 463 } |
| 458 | 464 |
| 459 WindowTreeHost* WindowTreeClient::WmNewDisplayAddedImpl( | 465 WindowTreeHostMus* WindowTreeClient::WmNewDisplayAddedImpl( |
| 460 const display::Display& display, | 466 const display::Display& display, |
| 461 ui::mojom::WindowDataPtr root_data, | 467 ui::mojom::WindowDataPtr root_data, |
| 462 bool parent_drawn) { | 468 bool parent_drawn) { |
| 463 DCHECK(window_manager_delegate_); | 469 DCHECK(window_manager_delegate_); |
| 464 | 470 |
| 465 window_manager_delegate_->OnWmWillCreateDisplay(display); | 471 window_manager_delegate_->OnWmWillCreateDisplay(display); |
| 466 | 472 |
| 467 std::unique_ptr<WindowTreeHostMus> window_tree_host = | 473 std::unique_ptr<WindowTreeHostMus> window_tree_host = |
| 468 CreateWindowTreeHost(WindowMusType::DISPLAY, root_data, display.id()); | 474 CreateWindowTreeHost(WindowMusType::DISPLAY, root_data, display.id()); |
| 469 | 475 |
| 470 WindowTreeHost* window_tree_host_ptr = window_tree_host.get(); | 476 WindowTreeHostMus* window_tree_host_ptr = window_tree_host.get(); |
| 471 window_manager_delegate_->OnWmNewDisplay(std::move(window_tree_host), | 477 window_manager_delegate_->OnWmNewDisplay(std::move(window_tree_host), |
| 472 display); | 478 display); |
| 473 return window_tree_host_ptr; | 479 return window_tree_host_ptr; |
| 474 } | 480 } |
| 475 | 481 |
| 476 std::unique_ptr<EventResultCallback> | 482 std::unique_ptr<EventResultCallback> |
| 477 WindowTreeClient::CreateEventResultCallback(int32_t event_id) { | 483 WindowTreeClient::CreateEventResultCallback(int32_t event_id) { |
| 478 return base::MakeUnique<EventResultCallback>( | 484 return base::MakeUnique<EventResultCallback>( |
| 479 base::Bind(&ui::mojom::WindowTree::OnWindowInputEventAck, | 485 base::Bind(&ui::mojom::WindowTree::OnWindowInputEventAck, |
| 480 base::Unretained(tree_), event_id)); | 486 base::Unretained(tree_), event_id)); |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1595 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1590 this, capture_synchronizer_.get(), window)); | 1596 this, capture_synchronizer_.get(), window)); |
| 1591 } | 1597 } |
| 1592 | 1598 |
| 1593 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1599 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1594 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1600 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1595 this, focus_synchronizer_.get(), window)); | 1601 this, focus_synchronizer_.get(), window)); |
| 1596 } | 1602 } |
| 1597 | 1603 |
| 1598 } // namespace aura | 1604 } // namespace aura |
| OLD | NEW |