| 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 <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS | 37 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS |
| 38 : public device::BluetoothAdapter, | 38 : public device::BluetoothAdapter, |
| 39 public chromeos::BluetoothAdapterClient::Observer, | 39 public chromeos::BluetoothAdapterClient::Observer, |
| 40 public chromeos::BluetoothDeviceClient::Observer, | 40 public chromeos::BluetoothDeviceClient::Observer, |
| 41 public chromeos::BluetoothInputClient::Observer, | 41 public chromeos::BluetoothInputClient::Observer, |
| 42 public chromeos::BluetoothAgentServiceProvider::Delegate { | 42 public chromeos::BluetoothAgentServiceProvider::Delegate { |
| 43 public: | 43 public: |
| 44 static base::WeakPtr<BluetoothAdapter> CreateAdapter(); | 44 static base::WeakPtr<BluetoothAdapter> CreateAdapter(); |
| 45 | 45 |
| 46 // BluetoothAdapter: | 46 // BluetoothAdapter: |
| 47 void DeleteOnCorrectThread() const override; |
| 47 virtual void AddObserver( | 48 virtual void AddObserver( |
| 48 device::BluetoothAdapter::Observer* observer) override; | 49 device::BluetoothAdapter::Observer* observer) override; |
| 49 virtual void RemoveObserver( | 50 virtual void RemoveObserver( |
| 50 device::BluetoothAdapter::Observer* observer) override; | 51 device::BluetoothAdapter::Observer* observer) override; |
| 51 virtual std::string GetAddress() const override; | 52 virtual std::string GetAddress() const override; |
| 52 virtual std::string GetName() const override; | 53 virtual std::string GetName() const override; |
| 53 virtual void SetName(const std::string& name, | 54 virtual void SetName(const std::string& name, |
| 54 const base::Closure& callback, | 55 const base::Closure& callback, |
| 55 const ErrorCallback& error_callback) override; | 56 const ErrorCallback& error_callback) override; |
| 56 virtual bool IsInitialized() const override; | 57 virtual bool IsInitialized() const override; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 110 |
| 110 // Returns the object path of the adapter. | 111 // Returns the object path of the adapter. |
| 111 const dbus::ObjectPath& object_path() const { return object_path_; } | 112 const dbus::ObjectPath& object_path() const { return object_path_; } |
| 112 | 113 |
| 113 protected: | 114 protected: |
| 114 // BluetoothAdapter: | 115 // BluetoothAdapter: |
| 115 virtual void RemovePairingDelegateInternal( | 116 virtual void RemovePairingDelegateInternal( |
| 116 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; | 117 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; |
| 117 | 118 |
| 118 private: | 119 private: |
| 120 friend class base::DeleteHelper<BluetoothAdapterChromeOS>; |
| 119 friend class BluetoothChromeOSTest; | 121 friend class BluetoothChromeOSTest; |
| 120 | 122 |
| 121 // typedef for callback parameters that are passed to AddDiscoverySession | 123 // typedef for callback parameters that are passed to AddDiscoverySession |
| 122 // and RemoveDiscoverySession. This is used to queue incoming requests while | 124 // and RemoveDiscoverySession. This is used to queue incoming requests while |
| 123 // a call to BlueZ is pending. | 125 // a call to BlueZ is pending. |
| 124 typedef std::pair<base::Closure, ErrorCallback> DiscoveryCallbackPair; | 126 typedef std::pair<base::Closure, ErrorCallback> DiscoveryCallbackPair; |
| 125 typedef std::queue<DiscoveryCallbackPair> DiscoveryCallbackQueue; | 127 typedef std::queue<DiscoveryCallbackPair> DiscoveryCallbackQueue; |
| 126 | 128 |
| 127 BluetoothAdapterChromeOS(); | 129 BluetoothAdapterChromeOS(); |
| 128 virtual ~BluetoothAdapterChromeOS(); | 130 virtual ~BluetoothAdapterChromeOS(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // Note: This should remain the last member so it'll be destroyed and | 275 // Note: This should remain the last member so it'll be destroyed and |
| 274 // invalidate its weak pointers before any other members are destroyed. | 276 // invalidate its weak pointers before any other members are destroyed. |
| 275 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; | 277 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; |
| 276 | 278 |
| 277 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); | 279 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); |
| 278 }; | 280 }; |
| 279 | 281 |
| 280 } // namespace chromeos | 282 } // namespace chromeos |
| 281 | 283 |
| 282 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 284 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
| OLD | NEW |