| 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/mus_context_factory.h" | 19 #include "ui/aura/mus/mus_context_factory.h" |
| 20 #include "ui/aura/mus/os_exchange_data_provider_mus.h" | 20 #include "ui/aura/mus/os_exchange_data_provider_mus.h" |
| 21 #include "ui/aura/mus/property_converter.h" | 21 #include "ui/aura/mus/property_converter.h" |
| 22 #include "ui/aura/mus/window_tree_client.h" | 22 #include "ui/aura/mus/window_tree_client.h" |
| 23 #include "ui/aura/mus/window_tree_host_mus.h" | 23 #include "ui/aura/mus/window_tree_host_mus.h" |
| 24 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
| 25 #include "ui/aura/window_tree_host.h" | 25 #include "ui/aura/window_tree_host.h" |
| 26 #include "ui/views/mus/aura_init.h" | 26 #include "ui/views/mus/aura_init.h" |
| 27 #include "ui/views/mus/clipboard_mus.h" | 27 #include "ui/views/mus/clipboard_mus.h" |
| 28 #include "ui/views/mus/desktop_window_tree_host_mus.h" | 28 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
| 29 #include "ui/views/mus/pointer_watcher_event_router2.h" | 29 #include "ui/views/mus/pointer_watcher_event_router.h" |
| 30 #include "ui/views/mus/screen_mus.h" | 30 #include "ui/views/mus/screen_mus.h" |
| 31 #include "ui/views/views_delegate.h" | 31 #include "ui/views/views_delegate.h" |
| 32 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 32 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 33 #include "ui/views/widget/widget_delegate.h" | 33 #include "ui/views/widget/widget_delegate.h" |
| 34 #include "ui/wm/core/capture_controller.h" | 34 #include "ui/wm/core/capture_controller.h" |
| 35 #include "ui/wm/core/wm_state.h" | 35 #include "ui/wm/core/wm_state.h" |
| 36 | 36 |
| 37 // Widget::InitParams::Type must match that of ui::mojom::WindowType. | 37 // Widget::InitParams::Type must match that of ui::mojom::WindowType. |
| 38 #define WINDOW_TYPES_MATCH(NAME) \ | 38 #define WINDOW_TYPES_MATCH(NAME) \ |
| 39 static_assert( \ | 39 static_assert( \ |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 compositor_context_factory_ = | 94 compositor_context_factory_ = |
| 95 base::MakeUnique<aura::MusContextFactory>(gpu_.get()); | 95 base::MakeUnique<aura::MusContextFactory>(gpu_.get()); |
| 96 aura::Env::GetInstance()->set_context_factory( | 96 aura::Env::GetInstance()->set_context_factory( |
| 97 compositor_context_factory_.get()); | 97 compositor_context_factory_.get()); |
| 98 window_tree_client_ = | 98 window_tree_client_ = |
| 99 base::MakeUnique<aura::WindowTreeClient>(connector, this); | 99 base::MakeUnique<aura::WindowTreeClient>(connector, this); |
| 100 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client_.get()); | 100 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client_.get()); |
| 101 window_tree_client_->ConnectViaWindowTreeFactory(); | 101 window_tree_client_->ConnectViaWindowTreeFactory(); |
| 102 | 102 |
| 103 pointer_watcher_event_router_ = | 103 pointer_watcher_event_router_ = |
| 104 base::MakeUnique<PointerWatcherEventRouter2>(window_tree_client_.get()); | 104 base::MakeUnique<PointerWatcherEventRouter>(window_tree_client_.get()); |
| 105 | 105 |
| 106 screen_ = base::MakeUnique<ScreenMus>(this); | 106 screen_ = base::MakeUnique<ScreenMus>(this); |
| 107 screen_->Init(connector); | 107 screen_->Init(connector); |
| 108 | 108 |
| 109 std::unique_ptr<ClipboardMus> clipboard = base::MakeUnique<ClipboardMus>(); | 109 std::unique_ptr<ClipboardMus> clipboard = base::MakeUnique<ClipboardMus>(); |
| 110 clipboard->Init(connector); | 110 clipboard->Init(connector); |
| 111 ui::Clipboard::SetClipboardForCurrentThread(std::move(clipboard)); | 111 ui::Clipboard::SetClipboardForCurrentThread(std::move(clipboard)); |
| 112 | 112 |
| 113 ui::OSExchangeDataProviderFactory::SetFactory(this); | 113 ui::OSExchangeDataProviderFactory::SetFactory(this); |
| 114 | 114 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 return root->GetTopWindowContainingPoint(relative_point); | 278 return root->GetTopWindowContainingPoint(relative_point); |
| 279 } | 279 } |
| 280 return nullptr; | 280 return nullptr; |
| 281 } | 281 } |
| 282 | 282 |
| 283 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { | 283 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { |
| 284 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | 284 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 } // namespace views | 287 } // namespace views |
| OLD | NEW |