Index: device/bluetooth/bluetooth_adapter_experimental_chromeos.h |
diff --git a/device/bluetooth/bluetooth_adapter_experimental_chromeos.h b/device/bluetooth/bluetooth_adapter_experimental_chromeos.h |
index 137935215d20324203f17afd185faf9a5ead300f..05fc1da342ff595de6d77022301b11036eda74e6 100644 |
--- a/device/bluetooth/bluetooth_adapter_experimental_chromeos.h |
+++ b/device/bluetooth/bluetooth_adapter_experimental_chromeos.h |
@@ -8,6 +8,9 @@ |
#include <string> |
#include "base/memory/weak_ptr.h" |
+#include "chromeos/dbus/experimental_bluetooth_adapter_client.h" |
+#include "chromeos/dbus/experimental_bluetooth_device_client.h" |
+#include "dbus/object_path.h" |
#include "device/bluetooth/bluetooth_adapter.h" |
namespace device { |
@@ -18,12 +21,16 @@ class BluetoothAdapterFactory; |
namespace chromeos { |
+class BluetoothDeviceExperimentalChromeOS; |
+ |
// The BluetoothAdapterExperimentalChromeOS class is an alternate implementation |
// of BluetoothAdapter for the Chrome OS platform using the Bluetooth Smart |
// capable backend. It will become the sole implementation for Chrome OS, and |
// be renamed to BluetoothAdapterChromeOS, once the backend is switched, |
class BluetoothAdapterExperimentalChromeOS |
- : public device::BluetoothAdapter { |
+ : public device::BluetoothAdapter, |
+ private chromeos::ExperimentalBluetoothAdapterClient::Observer, |
+ private chromeos::ExperimentalBluetoothDeviceClient::Observer { |
public: |
// BluetoothAdapter override |
virtual void AddObserver( |
@@ -53,10 +60,53 @@ class BluetoothAdapterExperimentalChromeOS |
private: |
friend class device::BluetoothAdapterFactory; |
+ friend class BluetoothDeviceExperimentalChromeOS; |
BluetoothAdapterExperimentalChromeOS(); |
virtual ~BluetoothAdapterExperimentalChromeOS(); |
+ // ExperimentalBluetoothAdapterClient::Observer override. |
+ virtual void AdapterAdded(const dbus::ObjectPath& object_path) OVERRIDE; |
+ virtual void AdapterRemoved(const dbus::ObjectPath& object_path) OVERRIDE; |
+ virtual void AdapterPropertyChanged( |
+ const dbus::ObjectPath& object_path, |
+ const std::string& property_name) OVERRIDE; |
+ |
+ // ExperimentalBluetoothDeviceClient::Observer override. |
+ virtual void DeviceAdded(const dbus::ObjectPath& object_path) OVERRIDE; |
+ virtual void DeviceRemoved(const dbus::ObjectPath& object_path) OVERRIDE; |
+ virtual void DevicePropertyChanged(const dbus::ObjectPath& object_path, |
+ const std::string& property_name) OVERRIDE; |
+ |
+ BluetoothDeviceExperimentalChromeOS* GetDeviceWithPath( |
+ const dbus::ObjectPath& object_path); |
+ |
+ void SetAdapter(const dbus::ObjectPath& object_path); |
+ void RemoveAdapter(); |
+ |
+ void PoweredChanged(bool powered); |
+ void DiscoveringChanged(bool discovering); |
+ void PresentChanged(bool present); |
+ |
+ void OnSetPowered(const base::Closure& callback, |
+ const ErrorCallback& error_callback, |
+ bool success); |
+ |
+ void OnStartDiscovery(const base::Closure& callback); |
+ void OnStartDiscoveryError(const ErrorCallback& error_callback, |
+ const std::string& error_name, |
+ const std::string& error_message); |
+ |
+ void OnStopDiscovery(const base::Closure& callback); |
+ void OnStopDiscoveryError(const ErrorCallback& error_callback, |
+ const std::string& error_name, |
+ const std::string& error_message); |
+ |
+ dbus::ObjectPath object_path_; |
+ |
+ // List of observers interested in event notifications from us. |
+ ObserverList<device::BluetoothAdapter::Observer> observers_; |
+ |
// Note: This should remain the last member so it'll be destroyed and |
// invalidate its weak pointers before any other members are destroyed. |
base::WeakPtrFactory<BluetoothAdapterExperimentalChromeOS> weak_ptr_factory_; |