Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 | 231 |
| 232 CrosDBusService::ServiceProviderList service_providers; | 232 CrosDBusService::ServiceProviderList service_providers; |
| 233 service_providers.push_back( | 233 service_providers.push_back( |
| 234 base::WrapUnique(ProxyResolutionServiceProvider::Create( | 234 base::WrapUnique(ProxyResolutionServiceProvider::Create( |
| 235 base::MakeUnique<ChromeProxyResolverDelegate>()))); | 235 base::MakeUnique<ChromeProxyResolverDelegate>()))); |
| 236 if (!ash_util::IsRunningInMash()) { | 236 if (!ash_util::IsRunningInMash()) { |
| 237 // TODO(crbug.com/629707): revisit this with mustash dbus work. | 237 // TODO(crbug.com/629707): revisit this with mustash dbus work. |
| 238 service_providers.push_back(base::MakeUnique<DisplayPowerServiceProvider>( | 238 service_providers.push_back(base::MakeUnique<DisplayPowerServiceProvider>( |
| 239 base::MakeUnique<ChromeDisplayPowerServiceProviderDelegate>())); | 239 base::MakeUnique<ChromeDisplayPowerServiceProviderDelegate>())); |
| 240 } | 240 } |
| 241 service_providers.push_back(base::MakeUnique<LivenessServiceProvider>()); | 241 // TODO(teravest): Remove this service provider once clients use |
| 242 // LivenessService instead of LibCrosService. | |
| 243 service_providers.push_back( | |
| 244 base::MakeUnique<LivenessServiceProvider>(kLibCrosServiceInterface)); | |
| 242 service_providers.push_back(base::MakeUnique<ScreenLockServiceProvider>()); | 245 service_providers.push_back(base::MakeUnique<ScreenLockServiceProvider>()); |
| 243 if (ash_util::IsRunningInMash()) { | 246 if (ash_util::IsRunningInMash()) { |
| 244 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( | 247 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( |
| 245 base::MakeUnique<MusConsoleServiceProviderDelegate>())); | 248 base::MakeUnique<MusConsoleServiceProviderDelegate>())); |
| 246 } else { | 249 } else { |
| 247 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( | 250 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( |
| 248 base::MakeUnique<ChromeConsoleServiceProviderDelegate>())); | 251 base::MakeUnique<ChromeConsoleServiceProviderDelegate>())); |
| 249 } | 252 } |
| 250 service_providers.push_back(base::MakeUnique<KioskInfoService>()); | 253 service_providers.push_back(base::MakeUnique<KioskInfoService>()); |
| 251 cros_dbus_service_ = CrosDBusService::Create( | 254 cros_dbus_service_ = CrosDBusService::Create( |
| 252 kLibCrosServiceName, dbus::ObjectPath(kLibCrosServicePath), | 255 kLibCrosServiceName, dbus::ObjectPath(kLibCrosServicePath), |
| 253 std::move(service_providers)); | 256 std::move(service_providers)); |
| 254 | 257 |
| 258 CrosDBusService::ServiceProviderList liveness_service_providers; | |
| 259 liveness_service_providers.push_back( | |
| 260 base::MakeUnique<LivenessServiceProvider>(kLivenessServiceInterface)); | |
| 261 liveness_service_ = CrosDBusService::Create( | |
| 262 kLivenessServiceName, dbus::ObjectPath(kLivenessServicePath), | |
| 263 std::move(liveness_service_providers)); | |
| 264 | |
| 255 // Initialize PowerDataCollector after DBusThreadManager is initialized. | 265 // Initialize PowerDataCollector after DBusThreadManager is initialized. |
| 256 PowerDataCollector::Initialize(); | 266 PowerDataCollector::Initialize(); |
| 257 | 267 |
| 258 LoginState::Initialize(); | 268 LoginState::Initialize(); |
| 259 SystemSaltGetter::Initialize(); | 269 SystemSaltGetter::Initialize(); |
| 260 TPMTokenLoader::Initialize(); | 270 TPMTokenLoader::Initialize(); |
| 261 CertLoader::Initialize(); | 271 CertLoader::Initialize(); |
| 262 | 272 |
| 263 disks::DiskMountManager::Initialize(); | 273 disks::DiskMountManager::Initialize(); |
| 264 cryptohome::AsyncMethodCaller::Initialize(); | 274 cryptohome::AsyncMethodCaller::Initialize(); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 294 network_connect_delegate_.reset(); | 304 network_connect_delegate_.reset(); |
| 295 CertLibrary::Shutdown(); | 305 CertLibrary::Shutdown(); |
| 296 NetworkHandler::Shutdown(); | 306 NetworkHandler::Shutdown(); |
| 297 cryptohome::AsyncMethodCaller::Shutdown(); | 307 cryptohome::AsyncMethodCaller::Shutdown(); |
| 298 disks::DiskMountManager::Shutdown(); | 308 disks::DiskMountManager::Shutdown(); |
| 299 SystemSaltGetter::Shutdown(); | 309 SystemSaltGetter::Shutdown(); |
| 300 LoginState::Shutdown(); | 310 LoginState::Shutdown(); |
| 301 CertLoader::Shutdown(); | 311 CertLoader::Shutdown(); |
| 302 TPMTokenLoader::Shutdown(); | 312 TPMTokenLoader::Shutdown(); |
| 303 cros_dbus_service_.reset(); | 313 cros_dbus_service_.reset(); |
| 314 liveness_service_.reset(); | |
| 304 PowerDataCollector::Shutdown(); | 315 PowerDataCollector::Shutdown(); |
| 305 PowerPolicyController::Shutdown(); | 316 PowerPolicyController::Shutdown(); |
| 306 device::BluetoothAdapterFactory::Shutdown(); | 317 device::BluetoothAdapterFactory::Shutdown(); |
| 307 bluez::BluezDBusManager::Shutdown(); | 318 bluez::BluezDBusManager::Shutdown(); |
| 308 | 319 |
| 309 // NOTE: This must only be called if Initialize() was called. | 320 // NOTE: This must only be called if Initialize() was called. |
| 310 DBusThreadManager::Shutdown(); | 321 DBusThreadManager::Shutdown(); |
| 311 } | 322 } |
| 312 | 323 |
| 313 private: | 324 private: |
| 314 // Hosts providers for the "org.chromium.LibCrosService" D-Bus service owned | 325 // Hosts providers for the "org.chromium.LibCrosService" D-Bus service owned |
| 315 // by Chrome. The name of this service was chosen for historical reasons that | 326 // by Chrome. The name of this service was chosen for historical reasons that |
| 316 // are irrelevant now. | 327 // are irrelevant now. |
| 317 // TODO(derat): Move these providers into more-specific services that are | 328 // TODO(derat): Move these providers into more-specific services that are |
| 318 // split between different processes: http://crbug.com/692246 | 329 // split between different processes: http://crbug.com/692246 |
| 319 std::unique_ptr<CrosDBusService> cros_dbus_service_; | 330 std::unique_ptr<CrosDBusService> cros_dbus_service_; |
| 331 std::unique_ptr<CrosDBusService> liveness_service_; | |
|
Daniel Erat
2017/03/13 16:22:59
nit: add a blank line above this line to separate
teravest
2017/03/13 16:26:05
Done.
| |
| 320 | 332 |
| 321 std::unique_ptr<NetworkConnectDelegateChromeOS> network_connect_delegate_; | 333 std::unique_ptr<NetworkConnectDelegateChromeOS> network_connect_delegate_; |
| 322 | 334 |
| 323 DISALLOW_COPY_AND_ASSIGN(DBusServices); | 335 DISALLOW_COPY_AND_ASSIGN(DBusServices); |
| 324 }; | 336 }; |
| 325 | 337 |
| 326 } // namespace internal | 338 } // namespace internal |
| 327 | 339 |
| 328 // ChromeBrowserMainPartsChromeos ---------------------------------------------- | 340 // ChromeBrowserMainPartsChromeos ---------------------------------------------- |
| 329 | 341 |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 958 | 970 |
| 959 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 971 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 960 | 972 |
| 961 // Destroy DeviceSettingsService after g_browser_process. | 973 // Destroy DeviceSettingsService after g_browser_process. |
| 962 DeviceSettingsService::Shutdown(); | 974 DeviceSettingsService::Shutdown(); |
| 963 | 975 |
| 964 chromeos::ShutdownCloseTracking(); | 976 chromeos::ShutdownCloseTracking(); |
| 965 } | 977 } |
| 966 | 978 |
| 967 } // namespace chromeos | 979 } // namespace chromeos |
| OLD | NEW |