| 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 "ui/aura/client/aura_constants.h" | 7 #include "ui/aura/client/aura_constants.h" |
| 8 #include "ui/aura/client/transient_window_client.h" | 8 #include "ui/aura/client/transient_window_client.h" |
| 9 #include "ui/aura/mus/property_converter.h" | 9 #include "ui/aura/mus/property_converter.h" |
| 10 #include "ui/aura/mus/surface_id_handler.h" | 10 #include "ui/aura/mus/surface_id_handler.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 GetPropertyConverter()->SetPropertyFromTransportValue(window_, property_name, | 213 GetPropertyConverter()->SetPropertyFromTransportValue(window_, property_name, |
| 214 property_data); | 214 property_data); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void WindowPortMus::SetSurfaceIdFromServer( | 217 void WindowPortMus::SetSurfaceIdFromServer( |
| 218 std::unique_ptr<SurfaceInfo> surface_info) { | 218 std::unique_ptr<SurfaceInfo> surface_info) { |
| 219 if (surface_info_) { | 219 if (surface_info_) { |
| 220 const cc::SurfaceId& existing_surface_id = surface_info_->surface_id; | 220 const cc::SurfaceId& existing_surface_id = surface_info_->surface_id; |
| 221 cc::SurfaceId new_surface_id = | 221 cc::SurfaceId new_surface_id = |
| 222 surface_info ? surface_info->surface_id : cc::SurfaceId(); | 222 surface_info ? surface_info->surface_id : cc::SurfaceId(); |
| 223 if (!existing_surface_id.is_null() && | 223 if (existing_surface_id.is_valid() && |
| 224 existing_surface_id != new_surface_id) { | 224 existing_surface_id != new_surface_id) { |
| 225 // Return the existing surface sequence. | 225 // Return the existing surface sequence. |
| 226 window_tree_client_->OnWindowMusSurfaceDetached( | 226 window_tree_client_->OnWindowMusSurfaceDetached( |
| 227 this, surface_info_->surface_sequence); | 227 this, surface_info_->surface_sequence); |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 WindowPortMus* parent = Get(window_->parent()); | 230 WindowPortMus* parent = Get(window_->parent()); |
| 231 if (parent && parent->surface_id_handler_) { | 231 if (parent && parent->surface_id_handler_) { |
| 232 parent->surface_id_handler_->OnChildWindowSurfaceChanged(window_, | 232 parent->surface_id_handler_->OnChildWindowSurfaceChanged(window_, |
| 233 &surface_info); | 233 &surface_info); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 change_data.property_name = | 356 change_data.property_name = |
| 357 GetPropertyConverter()->GetTransportNameForPropertyKey(key); | 357 GetPropertyConverter()->GetTransportNameForPropertyKey(key); |
| 358 // TODO(sky): investigate to see if we need to compare data. In particular do | 358 // TODO(sky): investigate to see if we need to compare data. In particular do |
| 359 // we ever have a case where changing a property cascades into changing the | 359 // we ever have a case where changing a property cascades into changing the |
| 360 // same property? | 360 // same property? |
| 361 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 361 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
| 362 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); | 362 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); |
| 363 } | 363 } |
| 364 | 364 |
| 365 } // namespace aura | 365 } // namespace aura |
| OLD | NEW |