| 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 "components/discardable_memory/client/client_discardable_shared_memory_
manager.h" | 10 #include "components/discardable_memory/client/client_discardable_shared_memory_
manager.h" |
| 11 #include "services/service_manager/public/cpp/connection.h" | 11 #include "services/service_manager/public/cpp/connection.h" |
| 12 #include "services/service_manager/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" |
| 13 #include "services/ui/public/cpp/gpu/gpu.h" | 13 #include "services/ui/public/cpp/gpu/gpu.h" |
| 14 #include "services/ui/public/cpp/property_type_converters.h" | 14 #include "services/ui/public/cpp/property_type_converters.h" |
| 15 #include "services/ui/public/interfaces/constants.mojom.h" | 15 #include "services/ui/public/interfaces/constants.mojom.h" |
| 16 #include "services/ui/public/interfaces/event_matcher.mojom.h" | 16 #include "services/ui/public/interfaces/event_matcher.mojom.h" |
| 17 #include "services/ui/public/interfaces/window_manager.mojom.h" | 17 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 18 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
| 19 #include "ui/aura/mus/capture_synchronizer.h" |
| 19 #include "ui/aura/mus/mus_context_factory.h" | 20 #include "ui/aura/mus/mus_context_factory.h" |
| 20 #include "ui/aura/mus/os_exchange_data_provider_mus.h" | 21 #include "ui/aura/mus/os_exchange_data_provider_mus.h" |
| 21 #include "ui/aura/mus/property_converter.h" | 22 #include "ui/aura/mus/property_converter.h" |
| 22 #include "ui/aura/mus/window_tree_client.h" | 23 #include "ui/aura/mus/window_tree_client.h" |
| 23 #include "ui/aura/mus/window_tree_host_mus.h" | 24 #include "ui/aura/mus/window_tree_host_mus.h" |
| 24 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
| 25 #include "ui/aura/window_tree_host.h" | 26 #include "ui/aura/window_tree_host.h" |
| 26 #include "ui/views/mus/aura_init.h" | 27 #include "ui/views/mus/aura_init.h" |
| 27 #include "ui/views/mus/clipboard_mus.h" | 28 #include "ui/views/mus/clipboard_mus.h" |
| 28 #include "ui/views/mus/desktop_window_tree_host_mus.h" | 29 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 } else { | 216 } else { |
| 216 std::map<std::string, std::vector<uint8_t>> mus_properties = | 217 std::map<std::string, std::vector<uint8_t>> mus_properties = |
| 217 ConfigurePropertiesFromParams(init_params); | 218 ConfigurePropertiesFromParams(init_params); |
| 218 native_widget->SetDesktopWindowTreeHost( | 219 native_widget->SetDesktopWindowTreeHost( |
| 219 base::MakeUnique<DesktopWindowTreeHostMus>(delegate, native_widget, | 220 base::MakeUnique<DesktopWindowTreeHostMus>(delegate, native_widget, |
| 220 &mus_properties)); | 221 &mus_properties)); |
| 221 } | 222 } |
| 222 return native_widget; | 223 return native_widget; |
| 223 } | 224 } |
| 224 | 225 |
| 226 void MusClient::OnCaptureClientSet( |
| 227 aura::client::CaptureClient* capture_client) { |
| 228 pointer_watcher_event_router_->AttachToCaptureClient(capture_client); |
| 229 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( |
| 230 capture_client); |
| 231 } |
| 232 |
| 233 void MusClient::OnCaptureClientUnset( |
| 234 aura::client::CaptureClient* capture_client) { |
| 235 pointer_watcher_event_router_->DetachFromCaptureClient(capture_client); |
| 236 window_tree_client_->capture_synchronizer()->DetachFromCaptureClient( |
| 237 capture_client); |
| 238 } |
| 239 |
| 225 void MusClient::AddObserver(MusClientObserver* observer) { | 240 void MusClient::AddObserver(MusClientObserver* observer) { |
| 226 observer_list_.AddObserver(observer); | 241 observer_list_.AddObserver(observer); |
| 227 } | 242 } |
| 228 | 243 |
| 229 void MusClient::RemoveObserver(MusClientObserver* observer) { | 244 void MusClient::RemoveObserver(MusClientObserver* observer) { |
| 230 observer_list_.RemoveObserver(observer); | 245 observer_list_.RemoveObserver(observer); |
| 231 } | 246 } |
| 232 void MusClient::SetMusPropertyMirror( | 247 void MusClient::SetMusPropertyMirror( |
| 233 std::unique_ptr<MusPropertyMirror> mirror) { | 248 std::unique_ptr<MusPropertyMirror> mirror) { |
| 234 mus_property_mirror_ = std::move(mirror); | 249 mus_property_mirror_ = std::move(mirror); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 return root->GetTopWindowContainingPoint(relative_point); | 292 return root->GetTopWindowContainingPoint(relative_point); |
| 278 } | 293 } |
| 279 return nullptr; | 294 return nullptr; |
| 280 } | 295 } |
| 281 | 296 |
| 282 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { | 297 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { |
| 283 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | 298 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); |
| 284 } | 299 } |
| 285 | 300 |
| 286 } // namespace views | 301 } // namespace views |
| OLD | NEW |