Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 // causes IsPresent to return false just before the dbus system is shutdown but | 50 // causes IsPresent to return false just before the dbus system is shutdown but |
| 51 // while references to the BluetoothAdapterChromeOS object still exists. | 51 // while references to the BluetoothAdapterChromeOS object still exists. |
| 52 // | 52 // |
| 53 // When adding methods to this class verify shutdown behavior in | 53 // When adding methods to this class verify shutdown behavior in |
| 54 // BluetoothChromeOSTest, Shutdown. | 54 // BluetoothChromeOSTest, Shutdown. |
| 55 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS | 55 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS |
| 56 : public device::BluetoothAdapter, | 56 : public device::BluetoothAdapter, |
| 57 public chromeos::BluetoothAdapterClient::Observer, | 57 public chromeos::BluetoothAdapterClient::Observer, |
| 58 public chromeos::BluetoothDeviceClient::Observer, | 58 public chromeos::BluetoothDeviceClient::Observer, |
| 59 public chromeos::BluetoothInputClient::Observer, | 59 public chromeos::BluetoothInputClient::Observer, |
| 60 public chromeos::BluetoothAgentServiceProvider::Delegate { | 60 public chromeos::BluetoothAgentServiceProvider::Delegate { |
|
omoikane
2015/05/22 23:55:27
Multiple inheritance is generally not allowed. Wh
| |
| 61 public: | 61 public: |
| 62 typedef base::Callback<void(const std::string& error_message)> | 62 typedef base::Callback<void(const std::string& error_message)> |
| 63 ErrorCompletionCallback; | 63 ErrorCompletionCallback; |
| 64 typedef base::Callback<void(BluetoothAdapterProfileChromeOS* profile)> | 64 typedef base::Callback<void(BluetoothAdapterProfileChromeOS* profile)> |
| 65 ProfileRegisteredCallback; | 65 ProfileRegisteredCallback; |
| 66 | 66 |
| 67 static base::WeakPtr<BluetoothAdapter> CreateAdapter(); | 67 static base::WeakPtr<BluetoothAdapter> CreateAdapter(); |
| 68 | 68 |
| 69 // BluetoothAdapter: | 69 // BluetoothAdapter: |
| 70 void Shutdown() override; | 70 void Shutdown() override; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 void RegisterAdvertisement( | 102 void RegisterAdvertisement( |
| 103 scoped_ptr<device::BluetoothAdvertisement::Data> advertisement_data, | 103 scoped_ptr<device::BluetoothAdvertisement::Data> advertisement_data, |
| 104 const CreateAdvertisementCallback& callback, | 104 const CreateAdvertisementCallback& callback, |
| 105 const CreateAdvertisementErrorCallback& error_callback) override; | 105 const CreateAdvertisementErrorCallback& error_callback) override; |
| 106 | 106 |
| 107 // Locates the device object by object path (the devices map and | 107 // Locates the device object by object path (the devices map and |
| 108 // BluetoothDevice methods are by address). | 108 // BluetoothDevice methods are by address). |
| 109 BluetoothDeviceChromeOS* GetDeviceWithPath( | 109 BluetoothDeviceChromeOS* GetDeviceWithPath( |
| 110 const dbus::ObjectPath& object_path); | 110 const dbus::ObjectPath& object_path); |
| 111 | 111 |
| 112 // Announce to observers a change in device state that is not reflected by | 112 // Announces to observers a change in device state that is not reflected by |
| 113 // its D-Bus properties. | 113 // its D-Bus properties. |
|
omoikane
2015/05/22 23:55:27
All function parameters should be documented with
Marie Janssen
2015/06/18 21:08:35
Done.
| |
| 114 void NotifyDeviceChanged(BluetoothDeviceChromeOS* device); | 114 void NotifyDeviceChanged(BluetoothDeviceChromeOS* device); |
| 115 | 115 |
| 116 // The following methods are used to send various GATT observer events to | 116 // The following methods are used to send various GATT observer events to |
| 117 // observers. | 117 // observers. |
| 118 void NotifyGattServiceAdded(BluetoothRemoteGattServiceChromeOS* service); | 118 void NotifyGattServiceAdded(BluetoothRemoteGattServiceChromeOS* service); |
| 119 void NotifyGattServiceRemoved(BluetoothRemoteGattServiceChromeOS* service); | 119 void NotifyGattServiceRemoved(BluetoothRemoteGattServiceChromeOS* service); |
| 120 void NotifyGattServiceChanged(BluetoothRemoteGattServiceChromeOS* service); | 120 void NotifyGattServiceChanged(BluetoothRemoteGattServiceChromeOS* service); |
| 121 void NotifyGattDiscoveryComplete(BluetoothRemoteGattServiceChromeOS* service); | 121 void NotifyGattDiscoveryComplete(BluetoothRemoteGattServiceChromeOS* service); |
| 122 void NotifyGattCharacteristicAdded( | 122 void NotifyGattCharacteristicAdded( |
| 123 BluetoothRemoteGattCharacteristicChromeOS* characteristic); | 123 BluetoothRemoteGattCharacteristicChromeOS* characteristic); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 140 // Request a profile on the adapter for a custom service with a | 140 // Request a profile on the adapter for a custom service with a |
| 141 // specific UUID for the device at |device_path| to be sent to |delegate|. | 141 // specific UUID for the device at |device_path| to be sent to |delegate|. |
| 142 // If |device_path| is the empty string, incoming connections will be | 142 // If |device_path| is the empty string, incoming connections will be |
| 143 // assigned to |delegate|. When the profile is | 143 // assigned to |delegate|. When the profile is |
| 144 // successfully registered, |success_callback| will be called with a pointer | 144 // successfully registered, |success_callback| will be called with a pointer |
| 145 // to the profile which is managed by BluetoothAdapterChromeOS. On failure, | 145 // to the profile which is managed by BluetoothAdapterChromeOS. On failure, |
| 146 // |error_callback| will be called. | 146 // |error_callback| will be called. |
| 147 void UseProfile(const device::BluetoothUUID& uuid, | 147 void UseProfile(const device::BluetoothUUID& uuid, |
| 148 const dbus::ObjectPath& device_path, | 148 const dbus::ObjectPath& device_path, |
| 149 const BluetoothProfileManagerClient::Options& options, | 149 const BluetoothProfileManagerClient::Options& options, |
| 150 BluetoothProfileServiceProvider::Delegate* delegate, | 150 BluetoothProfileServiceProvider::Delegate* delegate, |
|
omoikane
2015/05/22 23:55:27
"delegate" looks like an output parameter because
Marie Janssen
2015/06/18 21:08:35
|delegate| is not an output parameter - it's an in
| |
| 151 const ProfileRegisteredCallback& success_callback, | 151 const ProfileRegisteredCallback& success_callback, |
| 152 const ErrorCompletionCallback& error_callback); | 152 const ErrorCompletionCallback& error_callback); |
| 153 | 153 |
| 154 // Release use of a profile by a device. | 154 // Release use of a profile by a device. |
| 155 void ReleaseProfile(const dbus::ObjectPath& device_path, | 155 void ReleaseProfile(const dbus::ObjectPath& device_path, |
| 156 BluetoothAdapterProfileChromeOS* profile); | 156 BluetoothAdapterProfileChromeOS* profile); |
| 157 | 157 |
| 158 protected: | 158 protected: |
| 159 // BluetoothAdapter: | 159 // BluetoothAdapter: |
| 160 void RemovePairingDelegateInternal( | 160 void RemovePairingDelegateInternal( |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 // Note: This should remain the last member so it'll be destroyed and | 377 // Note: This should remain the last member so it'll be destroyed and |
| 378 // invalidate its weak pointers before any other members are destroyed. | 378 // invalidate its weak pointers before any other members are destroyed. |
| 379 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; | 379 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; |
| 380 | 380 |
| 381 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); | 381 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); |
| 382 }; | 382 }; |
| 383 | 383 |
| 384 } // namespace chromeos | 384 } // namespace chromeos |
| 385 | 385 |
| 386 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 386 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
| OLD | NEW |