| 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 const ErrorCallback& error_callback) = 0; | 253 const ErrorCallback& error_callback) = 0; |
| 254 | 254 |
| 255 // Indicates whether the adapter is initialized and ready to use. | 255 // Indicates whether the adapter is initialized and ready to use. |
| 256 virtual bool IsInitialized() const = 0; | 256 virtual bool IsInitialized() const = 0; |
| 257 | 257 |
| 258 // Indicates whether the adapter is actually present on the system. For the | 258 // Indicates whether the adapter is actually present on the system. For the |
| 259 // default adapter, this indicates whether any adapter is present. An adapter | 259 // default adapter, this indicates whether any adapter is present. An adapter |
| 260 // is only considered present if the address has been obtained. | 260 // is only considered present if the address has been obtained. |
| 261 virtual bool IsPresent() const = 0; | 261 virtual bool IsPresent() const = 0; |
| 262 | 262 |
| 263 // Disables Bluetooth completely without shutting it down. |
| 264 virtual void SetDisabled(bool disabled) = 0; |
| 265 |
| 263 // Indicates whether the adapter radio is powered. | 266 // Indicates whether the adapter radio is powered. |
| 264 virtual bool IsPowered() const = 0; | 267 virtual bool IsPowered() const = 0; |
| 265 | 268 |
| 266 // Requests a change to the adapter radio power. Setting |powered| to true | 269 // Requests a change to the adapter radio power. Setting |powered| to true |
| 267 // will turn on the radio and false will turn it off. On success, |callback| | 270 // will turn on the radio and false will turn it off. On success, |callback| |
| 268 // will be called. On failure, |error_callback| will be called. | 271 // will be called. On failure, |error_callback| will be called. |
| 269 virtual void SetPowered(bool powered, | 272 virtual void SetPowered(bool powered, |
| 270 const base::Closure& callback, | 273 const base::Closure& callback, |
| 271 const ErrorCallback& error_callback) = 0; | 274 const ErrorCallback& error_callback) = 0; |
| 272 | 275 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 551 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
| 549 | 552 |
| 550 // Note: This should remain the last member so it'll be destroyed and | 553 // Note: This should remain the last member so it'll be destroyed and |
| 551 // invalidate its weak pointers before any other members are destroyed. | 554 // invalidate its weak pointers before any other members are destroyed. |
| 552 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 555 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
| 553 }; | 556 }; |
| 554 | 557 |
| 555 } // namespace device | 558 } // namespace device |
| 556 | 559 |
| 557 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 560 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| OLD | NEW |