| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 void WindowPortMus::Embed( | 69 void WindowPortMus::Embed( |
| 70 ui::mojom::WindowTreeClientPtr client, | 70 ui::mojom::WindowTreeClientPtr client, |
| 71 uint32_t flags, | 71 uint32_t flags, |
| 72 const ui::mojom::WindowTree::EmbedCallback& callback) { | 72 const ui::mojom::WindowTree::EmbedCallback& callback) { |
| 73 window_tree_client_->Embed(window_, std::move(client), flags, callback); | 73 window_tree_client_->Embed(window_, std::move(client), flags, callback); |
| 74 } | 74 } |
| 75 | 75 |
| 76 std::unique_ptr<WindowCompositorFrameSink> | 76 std::unique_ptr<WindowCompositorFrameSink> |
| 77 WindowPortMus::RequestCompositorFrameSink( | 77 WindowPortMus::RequestCompositorFrameSink( |
| 78 ui::mojom::CompositorFrameSinkType type, | |
| 79 scoped_refptr<cc::ContextProvider> context_provider, | 78 scoped_refptr<cc::ContextProvider> context_provider, |
| 80 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { | 79 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { |
| 81 std::unique_ptr<WindowCompositorFrameSinkBinding> | 80 std::unique_ptr<WindowCompositorFrameSinkBinding> |
| 82 compositor_frame_sink_binding; | 81 compositor_frame_sink_binding; |
| 83 std::unique_ptr<WindowCompositorFrameSink> compositor_frame_sink = | 82 std::unique_ptr<WindowCompositorFrameSink> compositor_frame_sink = |
| 84 WindowCompositorFrameSink::Create(std::move(context_provider), | 83 WindowCompositorFrameSink::Create(std::move(context_provider), |
| 85 gpu_memory_buffer_manager, | 84 gpu_memory_buffer_manager, |
| 86 &compositor_frame_sink_binding); | 85 &compositor_frame_sink_binding); |
| 87 AttachCompositorFrameSink(type, std::move(compositor_frame_sink_binding)); | 86 AttachCompositorFrameSink(std::move(compositor_frame_sink_binding)); |
| 88 return compositor_frame_sink; | 87 return compositor_frame_sink; |
| 89 } | 88 } |
| 90 | 89 |
| 91 void WindowPortMus::AttachCompositorFrameSink( | 90 void WindowPortMus::AttachCompositorFrameSink( |
| 92 ui::mojom::CompositorFrameSinkType type, | |
| 93 std::unique_ptr<WindowCompositorFrameSinkBinding> | 91 std::unique_ptr<WindowCompositorFrameSinkBinding> |
| 94 compositor_frame_sink_binding) { | 92 compositor_frame_sink_binding) { |
| 95 window_tree_client_->AttachCompositorFrameSink( | 93 window_tree_client_->AttachCompositorFrameSink( |
| 96 server_id(), type, | 94 server_id(), |
| 97 std::move(compositor_frame_sink_binding->compositor_frame_sink_request_), | 95 std::move(compositor_frame_sink_binding->compositor_frame_sink_request_), |
| 98 mojo::MakeProxy(std::move( | 96 mojo::MakeProxy(std::move( |
| 99 compositor_frame_sink_binding->compositor_frame_sink_client_))); | 97 compositor_frame_sink_binding->compositor_frame_sink_client_))); |
| 100 } | 98 } |
| 101 | 99 |
| 102 WindowPortMus::ServerChangeIdType WindowPortMus::ScheduleChange( | 100 WindowPortMus::ServerChangeIdType WindowPortMus::ScheduleChange( |
| 103 const ServerChangeType type, | 101 const ServerChangeType type, |
| 104 const ServerChangeData& data) { | 102 const ServerChangeData& data) { |
| 105 ServerChange change; | 103 ServerChange change; |
| 106 change.type = type; | 104 change.type = type; |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 change_data.property_name = | 429 change_data.property_name = |
| 432 GetPropertyConverter()->GetTransportNameForPropertyKey(key); | 430 GetPropertyConverter()->GetTransportNameForPropertyKey(key); |
| 433 // TODO(sky): investigate to see if we need to compare data. In particular do | 431 // TODO(sky): investigate to see if we need to compare data. In particular do |
| 434 // we ever have a case where changing a property cascades into changing the | 432 // we ever have a case where changing a property cascades into changing the |
| 435 // same property? | 433 // same property? |
| 436 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 434 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
| 437 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); | 435 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); |
| 438 } | 436 } |
| 439 | 437 |
| 440 } // namespace aura | 438 } // namespace aura |
| OLD | NEW |