| 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" |
| 11 #include "ui/aura/mus/property_converter.h" | 11 #include "ui/aura/mus/property_converter.h" |
| 12 #include "ui/aura/mus/surface_id_handler.h" | |
| 13 #include "ui/aura/mus/window_tree_client.h" | 12 #include "ui/aura/mus/window_tree_client.h" |
| 14 #include "ui/aura/mus/window_tree_client_delegate.h" | 13 #include "ui/aura/mus/window_tree_client_delegate.h" |
| 15 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 16 #include "ui/aura/window_delegate.h" | 15 #include "ui/aura/window_delegate.h" |
| 17 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
| 18 #include "ui/aura/window_property.h" | 17 #include "ui/aura/window_property.h" |
| 19 | 18 |
| 20 namespace aura { | 19 namespace aura { |
| 21 | 20 |
| 22 WindowPortMus::WindowMusChangeDataImpl::WindowMusChangeDataImpl() = default; | 21 WindowPortMus::WindowMusChangeDataImpl::WindowMusChangeDataImpl() = default; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 void WindowPortMus::SetSurfaceInfoFromServer( | 247 void WindowPortMus::SetSurfaceInfoFromServer( |
| 249 const cc::SurfaceInfo& surface_info) { | 248 const cc::SurfaceInfo& surface_info) { |
| 250 if (surface_info_.id().is_valid()) { | 249 if (surface_info_.id().is_valid()) { |
| 251 const cc::SurfaceId& existing_surface_id = surface_info_.id(); | 250 const cc::SurfaceId& existing_surface_id = surface_info_.id(); |
| 252 const cc::SurfaceId& new_surface_id = surface_info.id(); | 251 const cc::SurfaceId& new_surface_id = surface_info.id(); |
| 253 if (existing_surface_id.is_valid() && | 252 if (existing_surface_id.is_valid() && |
| 254 existing_surface_id != new_surface_id) { | 253 existing_surface_id != new_surface_id) { |
| 255 // TODO(kylechar): Start return reference here? | 254 // TODO(kylechar): Start return reference here? |
| 256 } | 255 } |
| 257 } | 256 } |
| 258 WindowPortMus* parent = Get(window_->parent()); | |
| 259 // TODO(mfomitchev): This is unused. We probably don't need this. | |
| 260 if (parent && parent->surface_id_handler_) { | |
| 261 parent->surface_id_handler_->OnChildWindowSurfaceChanged(window_, | |
| 262 surface_info); | |
| 263 } | |
| 264 | 257 |
| 265 // The fact that SetSurfaceIdFromServer was called means that this window | 258 // The fact that SetSurfaceIdFromServer was called means that this window |
| 266 // corresponds to an embedded client. | 259 // corresponds to an embedded client. |
| 267 if (!client_surface_embedder && surface_info.id().is_valid()) | 260 if (!client_surface_embedder && surface_info.id().is_valid()) |
| 268 client_surface_embedder = base::MakeUnique<ClientSurfaceEmbedder>(window_); | 261 client_surface_embedder = base::MakeUnique<ClientSurfaceEmbedder>(window_); |
| 269 | 262 |
| 270 if (surface_info.id().is_valid()) | 263 if (surface_info.id().is_valid()) |
| 271 client_surface_embedder->UpdateSurface(surface_info); | 264 client_surface_embedder->UpdateSurface(surface_info); |
| 272 else | 265 else |
| 273 client_surface_embedder.reset(); | 266 client_surface_embedder.reset(); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 change_data.property_name = | 431 change_data.property_name = |
| 439 GetPropertyConverter()->GetTransportNameForPropertyKey(key); | 432 GetPropertyConverter()->GetTransportNameForPropertyKey(key); |
| 440 // TODO(sky): investigate to see if we need to compare data. In particular do | 433 // TODO(sky): investigate to see if we need to compare data. In particular do |
| 441 // we ever have a case where changing a property cascades into changing the | 434 // we ever have a case where changing a property cascades into changing the |
| 442 // same property? | 435 // same property? |
| 443 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 436 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
| 444 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); | 437 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); |
| 445 } | 438 } |
| 446 | 439 |
| 447 } // namespace aura | 440 } // namespace aura |
| OLD | NEW |