OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ash/mus/window_manager_application.h" | 5 #include "ash/mus/window_manager_application.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/mojo_interface_factory.h" | 9 #include "ash/mojo_interface_factory.h" |
10 #include "ash/mus/network_connect_delegate_mus.h" | 10 #include "ash/mus/network_connect_delegate_mus.h" |
11 #include "ash/mus/window_manager.h" | 11 #include "ash/mus/window_manager.h" |
12 #include "ash/public/cpp/config.h" | 12 #include "ash/public/cpp/config.h" |
13 #include "ash/shell_delegate.h" | 13 #include "ash/shell_delegate.h" |
14 #include "ash/system/power/power_status.h" | 14 #include "ash/system/power/power_status.h" |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "chromeos/audio/cras_audio_handler.h" | 19 #include "chromeos/audio/cras_audio_handler.h" |
| 20 #include "chromeos/cryptohome/system_salt_getter.h" |
20 #include "chromeos/dbus/dbus_thread_manager.h" | 21 #include "chromeos/dbus/dbus_thread_manager.h" |
21 #include "chromeos/network/network_connect.h" | 22 #include "chromeos/network/network_connect.h" |
22 #include "chromeos/network/network_handler.h" | 23 #include "chromeos/network/network_handler.h" |
23 #include "chromeos/system/fake_statistics_provider.h" | 24 #include "chromeos/system/fake_statistics_provider.h" |
24 #include "device/bluetooth/bluetooth_adapter_factory.h" | 25 #include "device/bluetooth/bluetooth_adapter_factory.h" |
25 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 26 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
26 #include "services/service_manager/public/cpp/connector.h" | 27 #include "services/service_manager/public/cpp/connector.h" |
27 #include "services/service_manager/public/cpp/service_context.h" | 28 #include "services/service_manager/public/cpp/service_context.h" |
28 #include "services/ui/common/accelerator_util.h" | 29 #include "services/ui/common/accelerator_util.h" |
29 #include "ui/aura/env.h" | 30 #include "ui/aura/env.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 chromeos::DBusThreadManager::Get()->GetSystemBus(), | 108 chromeos::DBusThreadManager::Get()->GetSystemBus(), |
108 chromeos::DBusThreadManager::Get()->IsUsingFakes()); | 109 chromeos::DBusThreadManager::Get()->IsUsingFakes()); |
109 if (init_network_handler && !chromeos::NetworkHandler::IsInitialized()) { | 110 if (init_network_handler && !chromeos::NetworkHandler::IsInitialized()) { |
110 chromeos::NetworkHandler::Initialize(); | 111 chromeos::NetworkHandler::Initialize(); |
111 network_handler_initialized_ = true; | 112 network_handler_initialized_ = true; |
112 } | 113 } |
113 network_connect_delegate_.reset(new NetworkConnectDelegateMus()); | 114 network_connect_delegate_.reset(new NetworkConnectDelegateMus()); |
114 chromeos::NetworkConnect::Initialize(network_connect_delegate_.get()); | 115 chromeos::NetworkConnect::Initialize(network_connect_delegate_.get()); |
115 // TODO(jamescook): Initialize real audio handler. | 116 // TODO(jamescook): Initialize real audio handler. |
116 chromeos::CrasAudioHandler::InitializeForTesting(); | 117 chromeos::CrasAudioHandler::InitializeForTesting(); |
| 118 chromeos::SystemSaltGetter::Initialize(); |
117 } | 119 } |
118 | 120 |
119 void WindowManagerApplication::ShutdownComponents() { | 121 void WindowManagerApplication::ShutdownComponents() { |
120 // NOTE: PowerStatus is shutdown by Shell. | 122 // NOTE: PowerStatus is shutdown by Shell. |
| 123 chromeos::SystemSaltGetter::Shutdown(); |
121 chromeos::CrasAudioHandler::Shutdown(); | 124 chromeos::CrasAudioHandler::Shutdown(); |
122 chromeos::NetworkConnect::Shutdown(); | 125 chromeos::NetworkConnect::Shutdown(); |
123 network_connect_delegate_.reset(); | 126 network_connect_delegate_.reset(); |
124 // We may not have started the NetworkHandler. | 127 // We may not have started the NetworkHandler. |
125 if (network_handler_initialized_) | 128 if (network_handler_initialized_) |
126 chromeos::NetworkHandler::Shutdown(); | 129 chromeos::NetworkHandler::Shutdown(); |
127 device::BluetoothAdapterFactory::Shutdown(); | 130 device::BluetoothAdapterFactory::Shutdown(); |
128 bluez::BluezDBusManager::Shutdown(); | 131 bluez::BluezDBusManager::Shutdown(); |
129 if (dbus_thread_manager_initialized_) | 132 if (dbus_thread_manager_initialized_) |
130 chromeos::DBusThreadManager::Shutdown(); | 133 chromeos::DBusThreadManager::Shutdown(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 void WindowManagerApplication::OnBindInterface( | 165 void WindowManagerApplication::OnBindInterface( |
163 const service_manager::BindSourceInfo& source_info, | 166 const service_manager::BindSourceInfo& source_info, |
164 const std::string& interface_name, | 167 const std::string& interface_name, |
165 mojo::ScopedMessagePipeHandle interface_pipe) { | 168 mojo::ScopedMessagePipeHandle interface_pipe) { |
166 registry_.BindInterface(source_info, interface_name, | 169 registry_.BindInterface(source_info, interface_name, |
167 std::move(interface_pipe)); | 170 std::move(interface_pipe)); |
168 } | 171 } |
169 | 172 |
170 } // namespace mus | 173 } // namespace mus |
171 } // namespace ash | 174 } // namespace ash |
OLD | NEW |