| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "content/renderer/mus/renderer_window_tree_client.h" | 5 #include "content/renderer/mus/renderer_window_tree_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "cc/base/switches.h" |
| 12 #include "content/renderer/gpu/render_widget_compositor.h" |
| 13 #include "content/renderer/render_frame_impl.h" |
| 14 #include "content/renderer/render_view_impl.h" |
| 15 #include "content/renderer/render_widget.h" |
| 10 #include "services/ui/public/cpp/client_compositor_frame_sink.h" | 16 #include "services/ui/public/cpp/client_compositor_frame_sink.h" |
| 11 | 17 |
| 12 namespace content { | 18 namespace content { |
| 13 | 19 |
| 14 namespace { | 20 namespace { |
| 15 typedef std::map<int, RendererWindowTreeClient*> ConnectionMap; | 21 typedef std::map<int, RendererWindowTreeClient*> ConnectionMap; |
| 16 base::LazyInstance<ConnectionMap>::Leaky g_connections = | 22 base::LazyInstance<ConnectionMap>::Leaky g_connections = |
| 17 LAZY_INSTANCE_INITIALIZER; | 23 LAZY_INSTANCE_INITIALIZER; |
| 18 } // namespace | 24 } // namespace |
| 19 | 25 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 int64_t display_id, | 138 int64_t display_id, |
| 133 bool drawn, | 139 bool drawn, |
| 134 const cc::FrameSinkId& frame_sink_id) { | 140 const cc::FrameSinkId& frame_sink_id) { |
| 135 NOTREACHED(); | 141 NOTREACHED(); |
| 136 } | 142 } |
| 137 | 143 |
| 138 void RendererWindowTreeClient::OnWindowBoundsChanged( | 144 void RendererWindowTreeClient::OnWindowBoundsChanged( |
| 139 ui::Id window_id, | 145 ui::Id window_id, |
| 140 const gfx::Rect& old_bounds, | 146 const gfx::Rect& old_bounds, |
| 141 const gfx::Rect& new_bounds, | 147 const gfx::Rect& new_bounds, |
| 142 const base::Optional<cc::LocalSurfaceId>& local_surface_id) {} | 148 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
| 149 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 150 cc::switches::kEnableSurfaceSynchronization)) { |
| 151 return; |
| 152 } |
| 153 current_local_surface_id_ = *local_surface_id; |
| 154 RenderFrameImpl* render_frame = RenderFrameImpl::FromRoutingID(routing_id_); |
| 155 RenderViewImpl* render_view = RenderViewImpl::FromRoutingID(routing_id_); |
| 156 if (!render_frame && !render_view) |
| 157 return; |
| 158 RenderWidget* widget = |
| 159 render_frame ? render_frame->GetRenderWidget() : render_view->GetWidget(); |
| 160 if (!widget) |
| 161 return; |
| 162 // TODO(fsamuel): This isn't quite correct. The resize arrives from the |
| 163 // browser and so it might not synchronize with the LocalSurfaceId. |
| 164 widget->compositor()->SetLocalSurfaceId(*local_surface_id); |
| 165 } |
| 143 | 166 |
| 144 void RendererWindowTreeClient::OnClientAreaChanged( | 167 void RendererWindowTreeClient::OnClientAreaChanged( |
| 145 uint32_t window_id, | 168 uint32_t window_id, |
| 146 const gfx::Insets& new_client_area, | 169 const gfx::Insets& new_client_area, |
| 147 const std::vector<gfx::Rect>& new_additional_client_areas) {} | 170 const std::vector<gfx::Rect>& new_additional_client_areas) {} |
| 148 | 171 |
| 149 void RendererWindowTreeClient::OnTransientWindowAdded( | 172 void RendererWindowTreeClient::OnTransientWindowAdded( |
| 150 uint32_t window_id, | 173 uint32_t window_id, |
| 151 uint32_t transient_window_id) {} | 174 uint32_t transient_window_id) {} |
| 152 | 175 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 uint32_t effect_bitmask, | 263 uint32_t effect_bitmask, |
| 241 const OnCompleteDropCallback& callback) {} | 264 const OnCompleteDropCallback& callback) {} |
| 242 | 265 |
| 243 void RendererWindowTreeClient::OnPerformDragDropCompleted( | 266 void RendererWindowTreeClient::OnPerformDragDropCompleted( |
| 244 uint32_t window, | 267 uint32_t window, |
| 245 bool success, | 268 bool success, |
| 246 uint32_t action_taken) {} | 269 uint32_t action_taken) {} |
| 247 | 270 |
| 248 void RendererWindowTreeClient::OnDragDropDone() {} | 271 void RendererWindowTreeClient::OnDragDropDone() {} |
| 249 | 272 |
| 273 void RendererWindowTreeClient::OnSetWindowBoundsResponse( |
| 274 uint32_t change_id, |
| 275 const gfx::Rect& bounds, |
| 276 const cc::LocalSurfaceId& local_surface_id) {} |
| 277 |
| 250 void RendererWindowTreeClient::OnChangeCompleted(uint32_t change_id, | 278 void RendererWindowTreeClient::OnChangeCompleted(uint32_t change_id, |
| 251 bool success) {} | 279 bool success) {} |
| 252 | 280 |
| 253 void RendererWindowTreeClient::RequestClose(uint32_t window_id) {} | 281 void RendererWindowTreeClient::RequestClose(uint32_t window_id) {} |
| 254 | 282 |
| 255 void RendererWindowTreeClient::GetWindowManager( | 283 void RendererWindowTreeClient::GetWindowManager( |
| 256 mojo::AssociatedInterfaceRequest<ui::mojom::WindowManager> internal) { | 284 mojo::AssociatedInterfaceRequest<ui::mojom::WindowManager> internal) { |
| 257 NOTREACHED(); | 285 NOTREACHED(); |
| 258 } | 286 } |
| 259 | 287 |
| 260 } // namespace content | 288 } // namespace content |
| OLD | NEW |