| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/dbus/cros_dbus_service.h" | 5 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
| 11 #include "chrome/browser/chromeos/dbus/display_power_service_provider.h" |
| 11 #include "chrome/browser/chromeos/dbus/liveness_service_provider.h" | 12 #include "chrome/browser/chromeos/dbus/liveness_service_provider.h" |
| 12 #include "chrome/browser/chromeos/dbus/printer_service_provider.h" | 13 #include "chrome/browser/chromeos/dbus/printer_service_provider.h" |
| 13 #include "chrome/browser/chromeos/dbus/proxy_resolution_service_provider.h" | 14 #include "chrome/browser/chromeos/dbus/proxy_resolution_service_provider.h" |
| 14 #include "chromeos/dbus/dbus_thread_manager.h" | 15 #include "chromeos/dbus/dbus_thread_manager.h" |
| 15 #include "dbus/bus.h" | 16 #include "dbus/bus.h" |
| 16 #include "dbus/exported_object.h" | 17 #include "dbus/exported_object.h" |
| 17 #include "dbus/object_path.h" | 18 #include "dbus/object_path.h" |
| 18 #include "third_party/cros_system_api/dbus/service_constants.h" | 19 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 19 | 20 |
| 20 namespace chromeos { | 21 namespace chromeos { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // static | 105 // static |
| 105 void CrosDBusService::Initialize() { | 106 void CrosDBusService::Initialize() { |
| 106 if (g_cros_dbus_service) { | 107 if (g_cros_dbus_service) { |
| 107 LOG(WARNING) << "CrosDBusService was already initialized"; | 108 LOG(WARNING) << "CrosDBusService was already initialized"; |
| 108 return; | 109 return; |
| 109 } | 110 } |
| 110 dbus::Bus* bus = DBusThreadManager::Get()->GetSystemBus(); | 111 dbus::Bus* bus = DBusThreadManager::Get()->GetSystemBus(); |
| 111 if (base::chromeos::IsRunningOnChromeOS() && bus) { | 112 if (base::chromeos::IsRunningOnChromeOS() && bus) { |
| 112 CrosDBusServiceImpl* service = new CrosDBusServiceImpl(bus); | 113 CrosDBusServiceImpl* service = new CrosDBusServiceImpl(bus); |
| 113 service->RegisterServiceProvider(ProxyResolutionServiceProvider::Create()); | 114 service->RegisterServiceProvider(ProxyResolutionServiceProvider::Create()); |
| 115 service->RegisterServiceProvider(new DisplayPowerServiceProvider); |
| 114 service->RegisterServiceProvider(new LivenessServiceProvider); | 116 service->RegisterServiceProvider(new LivenessServiceProvider); |
| 115 service->RegisterServiceProvider(new PrinterServiceProvider); | 117 service->RegisterServiceProvider(new PrinterServiceProvider); |
| 116 g_cros_dbus_service = service; | 118 g_cros_dbus_service = service; |
| 117 service->Start(); | 119 service->Start(); |
| 118 } else { | 120 } else { |
| 119 g_cros_dbus_service = new CrosDBusServiceStubImpl; | 121 g_cros_dbus_service = new CrosDBusServiceStubImpl; |
| 120 } | 122 } |
| 121 VLOG(1) << "CrosDBusService initialized"; | 123 VLOG(1) << "CrosDBusService initialized"; |
| 122 } | 124 } |
| 123 | 125 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 143 VLOG(1) << "CrosDBusService Shutdown completed"; | 145 VLOG(1) << "CrosDBusService Shutdown completed"; |
| 144 } | 146 } |
| 145 | 147 |
| 146 CrosDBusService::~CrosDBusService() { | 148 CrosDBusService::~CrosDBusService() { |
| 147 } | 149 } |
| 148 | 150 |
| 149 CrosDBusService::ServiceProviderInterface::~ServiceProviderInterface() { | 151 CrosDBusService::ServiceProviderInterface::~ServiceProviderInterface() { |
| 150 } | 152 } |
| 151 | 153 |
| 152 } // namespace chromeos | 154 } // namespace chromeos |
| OLD | NEW |