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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 if (visible) | 607 if (visible) |
| 608 window_tree_host->Show(); | 608 window_tree_host->Show(); |
| 609 else | 609 else |
| 610 window_tree_host->Hide(); | 610 window_tree_host->Hide(); |
| 611 } | 611 } |
| 612 | 612 |
| 613 void WindowTreeClient::ScheduleInFlightBoundsChange( | 613 void WindowTreeClient::ScheduleInFlightBoundsChange( |
| 614 WindowMus* window, | 614 WindowMus* window, |
| 615 const gfx::Rect& old_bounds, | 615 const gfx::Rect& old_bounds, |
| 616 const gfx::Rect& new_bounds) { | 616 const gfx::Rect& new_bounds) { |
| 617 // TODO(fsamuel): Allocate a new LocalSurfaceId on size change. | |
| 618 const uint32_t change_id = | 617 const uint32_t change_id = |
| 619 ScheduleInFlightChange(base::MakeUnique<InFlightBoundsChange>( | 618 ScheduleInFlightChange(base::MakeUnique<InFlightBoundsChange>( |
| 620 this, window, old_bounds, base::nullopt)); | 619 this, window, old_bounds, window->GetLocalSurfaceId())); |
| 620 base::Optional<cc::LocalSurfaceId> local_surface_id; | |
| 621 if ((window->window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || | |
| 622 window->window_mus_type() == WindowMusType::EMBED_IN_OWNER)) { | |
| 623 local_surface_id = window->GetOrAllocateLocalSurfaceId(new_bounds.size()); | |
| 624 } | |
| 621 tree_->SetWindowBounds(change_id, window->server_id(), new_bounds, | 625 tree_->SetWindowBounds(change_id, window->server_id(), new_bounds, |
| 622 base::nullopt); | 626 local_surface_id); |
|
sky
2017/03/29 00:07:35
Please add test coverage that the id sent to the s
Fady Samuel
2017/03/29 22:10:14
Done! Found a bug a fixed it. I've added two tests
| |
| 623 } | 627 } |
| 624 | 628 |
| 625 void WindowTreeClient::OnWindowMusCreated(WindowMus* window) { | 629 void WindowTreeClient::OnWindowMusCreated(WindowMus* window) { |
| 626 if (window->server_id() != kInvalidServerId) | 630 if (window->server_id() != kInvalidServerId) |
| 627 return; | 631 return; |
| 628 | 632 |
| 629 window->set_server_id(MakeTransportId(client_id_, next_window_id_++)); | 633 window->set_server_id(MakeTransportId(client_id_, next_window_id_++)); |
| 630 RegisterWindowMus(window); | 634 RegisterWindowMus(window); |
| 631 | 635 |
| 632 DCHECK(window_manager_delegate_ || !IsRoot(window)); | 636 DCHECK(window_manager_delegate_ || !IsRoot(window)); |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1919 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1923 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1920 this, capture_synchronizer_.get(), window)); | 1924 this, capture_synchronizer_.get(), window)); |
| 1921 } | 1925 } |
| 1922 | 1926 |
| 1923 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1927 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1924 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1928 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1925 this, focus_synchronizer_.get(), window)); | 1929 this, focus_synchronizer_.get(), window)); |
| 1926 } | 1930 } |
| 1927 | 1931 |
| 1928 } // namespace aura | 1932 } // namespace aura |
| OLD | NEW |