| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_port_mus.h" | 5 #include "ui/aura/mus/window_port_mus.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/client/transient_window_client.h" | 9 #include "ui/aura/client/transient_window_client.h" |
| 10 #include "ui/aura/mus/client_surface_embedder.h" | 10 #include "ui/aura/mus/client_surface_embedder.h" |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 // we ever have a case where changing a property cascades into changing the | 517 // we ever have a case where changing a property cascades into changing the |
| 518 // same property? | 518 // same property? |
| 519 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 519 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
| 520 window_tree_client_->OnWindowMusPropertyChanged(this, key, old_value, | 520 window_tree_client_->OnWindowMusPropertyChanged(this, key, old_value, |
| 521 std::move(data)); | 521 std::move(data)); |
| 522 } | 522 } |
| 523 | 523 |
| 524 void WindowPortMus::UpdatePrimarySurfaceInfo() { | 524 void WindowPortMus::UpdatePrimarySurfaceInfo() { |
| 525 bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || | 525 bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || |
| 526 window_mus_type() == WindowMusType::EMBED_IN_OWNER; | 526 window_mus_type() == WindowMusType::EMBED_IN_OWNER; |
| 527 if (!embeds_surface) | 527 if (!embeds_surface || !window_tree_client_->enable_surface_synchronization_) |
| 528 return; | 528 return; |
| 529 | 529 |
| 530 if (!frame_sink_id_.is_valid() || !local_surface_id_.is_valid()) | 530 if (!frame_sink_id_.is_valid() || !local_surface_id_.is_valid()) |
| 531 return; | 531 return; |
| 532 | 532 |
| 533 SetPrimarySurfaceInfo( | 533 SetPrimarySurfaceInfo( |
| 534 cc::SurfaceInfo(cc::SurfaceId(frame_sink_id_, local_surface_id_), | 534 cc::SurfaceInfo(cc::SurfaceId(frame_sink_id_, local_surface_id_), |
| 535 ScaleFactorForDisplay(window_), last_surface_size_)); | 535 ScaleFactorForDisplay(window_), last_surface_size_)); |
| 536 } | 536 } |
| 537 | 537 |
| 538 void WindowPortMus::UpdateClientSurfaceEmbedder() { | 538 void WindowPortMus::UpdateClientSurfaceEmbedder() { |
| 539 bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || | 539 bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || |
| 540 window_mus_type() == WindowMusType::EMBED_IN_OWNER; | 540 window_mus_type() == WindowMusType::EMBED_IN_OWNER; |
| 541 if (!embeds_surface) | 541 if (!embeds_surface) |
| 542 return; | 542 return; |
| 543 | 543 |
| 544 if (!client_surface_embedder_) { | 544 if (!client_surface_embedder_) { |
| 545 client_surface_embedder_ = base::MakeUnique<ClientSurfaceEmbedder>( | 545 client_surface_embedder_ = base::MakeUnique<ClientSurfaceEmbedder>( |
| 546 window_, window_tree_client_->normal_client_area_insets_); | 546 window_, window_tree_client_->normal_client_area_insets_); |
| 547 } | 547 } |
| 548 | 548 |
| 549 client_surface_embedder_->SetPrimarySurfaceInfo(primary_surface_info_); | 549 client_surface_embedder_->SetPrimarySurfaceInfo(primary_surface_info_); |
| 550 client_surface_embedder_->SetFallbackSurfaceInfo(fallback_surface_info_); | 550 client_surface_embedder_->SetFallbackSurfaceInfo(fallback_surface_info_); |
| 551 } | 551 } |
| 552 | 552 |
| 553 } // namespace aura | 553 } // namespace aura |
| OLD | NEW |