| 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/views/mus/mus_client.h" | 5 #include "ui/views/mus/mus_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| 11 #include "services/ui/public/cpp/gpu/gpu.h" | 11 #include "services/ui/public/cpp/gpu/gpu.h" |
| 12 #include "services/ui/public/cpp/property_type_converters.h" | 12 #include "services/ui/public/cpp/property_type_converters.h" |
| 13 #include "services/ui/public/interfaces/constants.mojom.h" | 13 #include "services/ui/public/interfaces/constants.mojom.h" |
| 14 #include "services/ui/public/interfaces/event_matcher.mojom.h" | 14 #include "services/ui/public/interfaces/event_matcher.mojom.h" |
| 15 #include "services/ui/public/interfaces/window_manager.mojom.h" | 15 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 16 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
| 17 #include "ui/aura/mus/capture_synchronizer.h" | 17 #include "ui/aura/mus/capture_synchronizer.h" |
| 18 #include "ui/aura/mus/mus_context_factory.h" | 18 #include "ui/aura/mus/mus_context_factory.h" |
| 19 #include "ui/aura/mus/property_converter.h" | 19 #include "ui/aura/mus/property_converter.h" |
| 20 #include "ui/aura/mus/window_tree_client.h" | 20 #include "ui/aura/mus/window_tree_client.h" |
| 21 #include "ui/aura/mus/window_tree_host_mus.h" | 21 #include "ui/aura/mus/window_tree_host_mus.h" |
| 22 #include "ui/aura/mus/window_tree_host_mus_init_params.h" |
| 22 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
| 23 #include "ui/aura/window_tree_host.h" | 24 #include "ui/aura/window_tree_host.h" |
| 24 #include "ui/views/mus/aura_init.h" | 25 #include "ui/views/mus/aura_init.h" |
| 25 #include "ui/views/mus/clipboard_mus.h" | 26 #include "ui/views/mus/clipboard_mus.h" |
| 26 #include "ui/views/mus/desktop_window_tree_host_mus.h" | 27 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
| 27 #include "ui/views/mus/mus_property_mirror.h" | 28 #include "ui/views/mus/mus_property_mirror.h" |
| 28 #include "ui/views/mus/pointer_watcher_event_router.h" | 29 #include "ui/views/mus/pointer_watcher_event_router.h" |
| 29 #include "ui/views/mus/screen_mus.h" | 30 #include "ui/views/mus/screen_mus.h" |
| 30 #include "ui/views/views_delegate.h" | 31 #include "ui/views/views_delegate.h" |
| 31 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 32 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 CHECK(server_test_ptr_); | 267 CHECK(server_test_ptr_); |
| 267 return server_test_ptr_.get(); | 268 return server_test_ptr_.get(); |
| 268 } | 269 } |
| 269 | 270 |
| 270 std::unique_ptr<DesktopWindowTreeHost> MusClient::CreateDesktopWindowTreeHost( | 271 std::unique_ptr<DesktopWindowTreeHost> MusClient::CreateDesktopWindowTreeHost( |
| 271 const Widget::InitParams& init_params, | 272 const Widget::InitParams& init_params, |
| 272 internal::NativeWidgetDelegate* delegate, | 273 internal::NativeWidgetDelegate* delegate, |
| 273 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 274 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 274 std::map<std::string, std::vector<uint8_t>> mus_properties = | 275 std::map<std::string, std::vector<uint8_t>> mus_properties = |
| 275 ConfigurePropertiesFromParams(init_params); | 276 ConfigurePropertiesFromParams(init_params); |
| 277 std::unique_ptr<aura::WindowTreeHostMusInitParams> |
| 278 window_tree_host_init_params = aura::CreateInitParamsForTopLevel( |
| 279 MusClient::Get()->window_tree_client(), std::move(mus_properties)); |
| 276 return base::MakeUnique<DesktopWindowTreeHostMus>( | 280 return base::MakeUnique<DesktopWindowTreeHostMus>( |
| 277 delegate, desktop_native_widget_aura, cc::FrameSinkId(), &mus_properties); | 281 std::move(window_tree_host_init_params), delegate, |
| 282 desktop_native_widget_aura); |
| 278 } | 283 } |
| 279 | 284 |
| 280 void MusClient::OnEmbed( | 285 void MusClient::OnEmbed( |
| 281 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) { | 286 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) { |
| 282 NOTREACHED(); | 287 NOTREACHED(); |
| 283 } | 288 } |
| 284 | 289 |
| 285 void MusClient::OnLostConnection(aura::WindowTreeClient* client) {} | 290 void MusClient::OnLostConnection(aura::WindowTreeClient* client) {} |
| 286 | 291 |
| 287 void MusClient::OnEmbedRootDestroyed( | 292 void MusClient::OnEmbedRootDestroyed( |
| (...skipping 24 matching lines...) Expand all Loading... |
| 312 // TODO: this likely gets z-order wrong. http://crbug.com/663606. | 317 // TODO: this likely gets z-order wrong. http://crbug.com/663606. |
| 313 gfx::Point relative_point(point); | 318 gfx::Point relative_point(point); |
| 314 window_tree_host->ConvertScreenInPixelsToDIP(&relative_point); | 319 window_tree_host->ConvertScreenInPixelsToDIP(&relative_point); |
| 315 if (gfx::Rect(root->bounds().size()).Contains(relative_point)) | 320 if (gfx::Rect(root->bounds().size()).Contains(relative_point)) |
| 316 return root->GetEventHandlerForPoint(relative_point); | 321 return root->GetEventHandlerForPoint(relative_point); |
| 317 } | 322 } |
| 318 return nullptr; | 323 return nullptr; |
| 319 } | 324 } |
| 320 | 325 |
| 321 } // namespace views | 326 } // namespace views |
| OLD | NEW |