Chromium Code Reviews| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 368 int64_t display_id) { | 368 int64_t display_id) { |
| 369 std::unique_ptr<WindowPortMus> window_port = | 369 std::unique_ptr<WindowPortMus> window_port = |
| 370 CreateWindowPortMus(window_data, window_mus_type); | 370 CreateWindowPortMus(window_data, window_mus_type); |
| 371 roots_.insert(window_port.get()); | 371 roots_.insert(window_port.get()); |
| 372 std::unique_ptr<WindowTreeHostMus> window_tree_host = | 372 std::unique_ptr<WindowTreeHostMus> window_tree_host = |
| 373 base::MakeUnique<WindowTreeHostMus>(std::move(window_port), this, | 373 base::MakeUnique<WindowTreeHostMus>(std::move(window_port), this, |
| 374 display_id); | 374 display_id); |
| 375 if (!window_data.is_null()) { | 375 if (!window_data.is_null()) { |
| 376 SetLocalPropertiesFromServerProperties( | 376 SetLocalPropertiesFromServerProperties( |
| 377 WindowMus::Get(window_tree_host->window()), window_data); | 377 WindowMus::Get(window_tree_host->window()), window_data); |
| 378 if (window_data->visible) { | |
| 379 SetWindowVisibleFromServer(WindowMus::Get(window_tree_host->window()), | |
| 380 window_data->visible); | |
| 381 SetWindowBoundsFromServer(WindowMus::Get(window_tree_host->window()), | |
| 382 window_data->bounds); | |
|
sadrul
2016/11/29 23:29:28
Should this set bounds regardless of visibility?
sky
2016/11/29 23:35:00
Good catch! done.
| |
| 383 } | |
| 378 } | 384 } |
| 379 return window_tree_host; | 385 return window_tree_host; |
| 380 } | 386 } |
| 381 | 387 |
| 382 WindowMus* WindowTreeClient::NewWindowFromWindowData( | 388 WindowMus* WindowTreeClient::NewWindowFromWindowData( |
| 383 WindowMus* parent, | 389 WindowMus* parent, |
| 384 const ui::mojom::WindowDataPtr& window_data) { | 390 const ui::mojom::WindowDataPtr& window_data) { |
| 385 // This function is only called for windows coming from other clients. | 391 // This function is only called for windows coming from other clients. |
| 386 std::unique_ptr<WindowPortMus> window_port_mus( | 392 std::unique_ptr<WindowPortMus> window_port_mus( |
| 387 CreateWindowPortMus(window_data, WindowMusType::OTHER)); | 393 CreateWindowPortMus(window_data, WindowMusType::OTHER)); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 463 DCHECK(roots_.empty()); | 469 DCHECK(roots_.empty()); |
| 464 std::unique_ptr<WindowTreeHostMus> window_tree_host = | 470 std::unique_ptr<WindowTreeHostMus> window_tree_host = |
| 465 CreateWindowTreeHost(WindowMusType::EMBED, root_data, display_id); | 471 CreateWindowTreeHost(WindowMusType::EMBED, root_data, display_id); |
| 466 | 472 |
| 467 focus_synchronizer_->SetFocusFromServer( | 473 focus_synchronizer_->SetFocusFromServer( |
| 468 GetWindowByServerId(focused_window_id)); | 474 GetWindowByServerId(focused_window_id)); |
| 469 | 475 |
| 470 delegate_->OnEmbed(std::move(window_tree_host)); | 476 delegate_->OnEmbed(std::move(window_tree_host)); |
| 471 } | 477 } |
| 472 | 478 |
| 473 WindowTreeHost* WindowTreeClient::WmNewDisplayAddedImpl( | 479 WindowTreeHostMus* WindowTreeClient::WmNewDisplayAddedImpl( |
| 474 const display::Display& display, | 480 const display::Display& display, |
| 475 ui::mojom::WindowDataPtr root_data, | 481 ui::mojom::WindowDataPtr root_data, |
| 476 bool parent_drawn) { | 482 bool parent_drawn) { |
| 477 DCHECK(window_manager_delegate_); | 483 DCHECK(window_manager_delegate_); |
| 478 | 484 |
| 479 std::unique_ptr<WindowTreeHostMus> window_tree_host = | 485 std::unique_ptr<WindowTreeHostMus> window_tree_host = |
| 480 CreateWindowTreeHost(WindowMusType::DISPLAY, root_data, display.id()); | 486 CreateWindowTreeHost(WindowMusType::DISPLAY, root_data, display.id()); |
| 481 | 487 |
| 482 WindowTreeHost* window_tree_host_ptr = window_tree_host.get(); | 488 WindowTreeHostMus* window_tree_host_ptr = window_tree_host.get(); |
| 483 window_manager_delegate_->OnWmNewDisplay(std::move(window_tree_host), | 489 window_manager_delegate_->OnWmNewDisplay(std::move(window_tree_host), |
| 484 display); | 490 display); |
| 485 return window_tree_host_ptr; | 491 return window_tree_host_ptr; |
| 486 } | 492 } |
| 487 | 493 |
| 488 std::unique_ptr<EventResultCallback> | 494 std::unique_ptr<EventResultCallback> |
| 489 WindowTreeClient::CreateEventResultCallback(int32_t event_id) { | 495 WindowTreeClient::CreateEventResultCallback(int32_t event_id) { |
| 490 return base::MakeUnique<EventResultCallback>( | 496 return base::MakeUnique<EventResultCallback>( |
| 491 base::Bind(&ui::mojom::WindowTree::OnWindowInputEventAck, | 497 base::Bind(&ui::mojom::WindowTree::OnWindowInputEventAck, |
| 492 base::Unretained(tree_), event_id)); | 498 base::Unretained(tree_), event_id)); |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1583 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1589 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1584 this, capture_synchronizer_.get(), window)); | 1590 this, capture_synchronizer_.get(), window)); |
| 1585 } | 1591 } |
| 1586 | 1592 |
| 1587 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1593 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1588 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1594 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1589 this, focus_synchronizer_.get(), window)); | 1595 this, focus_synchronizer_.get(), window)); |
| 1590 } | 1596 } |
| 1591 | 1597 |
| 1592 } // namespace aura | 1598 } // namespace aura |
| OLD | NEW |