| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 predefined_cursor_ = cursor_id; | 66 predefined_cursor_ = cursor_id; |
| 67 } | 67 } |
| 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<ui::WindowCompositorFrameSink> |
| 77 WindowPortMus::RequestCompositorFrameSink( | 77 WindowPortMus::RequestCompositorFrameSink( |
| 78 scoped_refptr<cc::ContextProvider> context_provider, | 78 scoped_refptr<cc::ContextProvider> context_provider, |
| 79 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { | 79 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { |
| 80 std::unique_ptr<WindowCompositorFrameSinkBinding> | 80 std::unique_ptr<ui::WindowCompositorFrameSinkBinding> |
| 81 compositor_frame_sink_binding; | 81 compositor_frame_sink_binding; |
| 82 std::unique_ptr<WindowCompositorFrameSink> compositor_frame_sink = | 82 std::unique_ptr<ui::WindowCompositorFrameSink> compositor_frame_sink = |
| 83 WindowCompositorFrameSink::Create( | 83 ui::WindowCompositorFrameSink::Create( |
| 84 cc::FrameSinkId(server_id(), 0), std::move(context_provider), | 84 cc::FrameSinkId(server_id(), 0), std::move(context_provider), |
| 85 gpu_memory_buffer_manager, &compositor_frame_sink_binding); | 85 gpu_memory_buffer_manager, &compositor_frame_sink_binding); |
| 86 AttachCompositorFrameSink(std::move(compositor_frame_sink_binding)); | 86 AttachCompositorFrameSink(std::move(compositor_frame_sink_binding)); |
| 87 return compositor_frame_sink; | 87 return compositor_frame_sink; |
| 88 } | 88 } |
| 89 | 89 |
| 90 void WindowPortMus::AttachCompositorFrameSink( | 90 void WindowPortMus::AttachCompositorFrameSink( |
| 91 std::unique_ptr<WindowCompositorFrameSinkBinding> | 91 std::unique_ptr<ui::WindowCompositorFrameSinkBinding> |
| 92 compositor_frame_sink_binding) { | 92 compositor_frame_sink_binding) { |
| 93 window_tree_client_->AttachCompositorFrameSink( | 93 window_tree_client_->AttachCompositorFrameSink( |
| 94 server_id(), | 94 server_id(), compositor_frame_sink_binding->TakeFrameSinkRequest(), |
| 95 std::move(compositor_frame_sink_binding->compositor_frame_sink_request_), | 95 mojo::MakeProxy(compositor_frame_sink_binding->TakeFrameSinkClient())); |
| 96 mojo::MakeProxy(std::move( | |
| 97 compositor_frame_sink_binding->compositor_frame_sink_client_))); | |
| 98 } | 96 } |
| 99 | 97 |
| 100 WindowPortMus::ServerChangeIdType WindowPortMus::ScheduleChange( | 98 WindowPortMus::ServerChangeIdType WindowPortMus::ScheduleChange( |
| 101 const ServerChangeType type, | 99 const ServerChangeType type, |
| 102 const ServerChangeData& data) { | 100 const ServerChangeData& data) { |
| 103 ServerChange change; | 101 ServerChange change; |
| 104 change.type = type; | 102 change.type = type; |
| 105 change.server_change_id = next_server_change_id_++; | 103 change.server_change_id = next_server_change_id_++; |
| 106 change.data = data; | 104 change.data = data; |
| 107 server_changes_.push_back(change); | 105 server_changes_.push_back(change); |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 change_data.property_name = | 427 change_data.property_name = |
| 430 GetPropertyConverter()->GetTransportNameForPropertyKey(key); | 428 GetPropertyConverter()->GetTransportNameForPropertyKey(key); |
| 431 // TODO(sky): investigate to see if we need to compare data. In particular do | 429 // TODO(sky): investigate to see if we need to compare data. In particular do |
| 432 // we ever have a case where changing a property cascades into changing the | 430 // we ever have a case where changing a property cascades into changing the |
| 433 // same property? | 431 // same property? |
| 434 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 432 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
| 435 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); | 433 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); |
| 436 } | 434 } |
| 437 | 435 |
| 438 } // namespace aura | 436 } // namespace aura |
| OLD | NEW |