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 "chromeos/dbus/dbus_thread_manager.h" | 5 #include "chromeos/dbus/dbus_thread_manager.h" |
6 | 6 |
7 #include "base/chromeos/chromeos_version.h" | 7 #include "base/chromeos/chromeos_version.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 : STUB_DBUS_CLIENT_IMPLEMENTATION; | 349 : STUB_DBUS_CLIENT_IMPLEMENTATION; |
350 | 350 |
351 if (ibus_engine_services_.find(object_path) | 351 if (ibus_engine_services_.find(object_path) |
352 == ibus_engine_services_.end()) { | 352 == ibus_engine_services_.end()) { |
353 ibus_engine_services_[object_path] = | 353 ibus_engine_services_[object_path] = |
354 IBusEngineService::Create(client_type, ibus_bus_.get(), object_path); | 354 IBusEngineService::Create(client_type, ibus_bus_.get(), object_path); |
355 } | 355 } |
356 return ibus_engine_services_[object_path]; | 356 return ibus_engine_services_[object_path]; |
357 } | 357 } |
358 | 358 |
| 359 // DBusThreadManager override. |
| 360 virtual void RemoveIBusEngineService(const dbus::ObjectPath& object_path) { |
| 361 if (ibus_engine_services_.find(object_path) != |
| 362 ibus_engine_services_.end()) { |
| 363 LOG(WARNING) << "Object path not found: " << object_path.value(); |
| 364 return; |
| 365 } |
| 366 delete ibus_engine_services_[object_path]; |
| 367 ibus_engine_services_.erase(object_path); |
| 368 } |
| 369 |
359 scoped_ptr<base::Thread> dbus_thread_; | 370 scoped_ptr<base::Thread> dbus_thread_; |
360 scoped_refptr<dbus::Bus> system_bus_; | 371 scoped_refptr<dbus::Bus> system_bus_; |
361 scoped_refptr<dbus::Bus> ibus_bus_; | 372 scoped_refptr<dbus::Bus> ibus_bus_; |
362 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; | 373 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; |
363 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; | 374 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; |
364 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; | 375 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; |
365 scoped_ptr<BluetoothManagerClient> bluetooth_manager_client_; | 376 scoped_ptr<BluetoothManagerClient> bluetooth_manager_client_; |
366 scoped_ptr<BluetoothNodeClient> bluetooth_node_client_; | 377 scoped_ptr<BluetoothNodeClient> bluetooth_node_client_; |
367 scoped_ptr<BluetoothOutOfBandClient> bluetooth_out_of_band_client_; | 378 scoped_ptr<BluetoothOutOfBandClient> bluetooth_out_of_band_client_; |
368 scoped_ptr<CashewClient> cashew_client_; | 379 scoped_ptr<CashewClient> cashew_client_; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 } | 459 } |
449 | 460 |
450 // static | 461 // static |
451 DBusThreadManager* DBusThreadManager::Get() { | 462 DBusThreadManager* DBusThreadManager::Get() { |
452 CHECK(g_dbus_thread_manager) | 463 CHECK(g_dbus_thread_manager) |
453 << "DBusThreadManager::Get() called before Initialize()"; | 464 << "DBusThreadManager::Get() called before Initialize()"; |
454 return g_dbus_thread_manager; | 465 return g_dbus_thread_manager; |
455 } | 466 } |
456 | 467 |
457 } // namespace chromeos | 468 } // namespace chromeos |
OLD | NEW |