Chromium Code Reviews| 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 CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 // is called, in the success case the callback is simply not called. | 91 // is called, in the success case the callback is simply not called. |
| 92 typedef base::Callback<void()> ErrorCallback; | 92 typedef base::Callback<void()> ErrorCallback; |
| 93 | 93 |
| 94 // The BluetoothOutOfBandPairingDataCallback is used to return | 94 // The BluetoothOutOfBandPairingDataCallback is used to return |
| 95 // BluetoothOutOfBandPairingData to the caller. | 95 // BluetoothOutOfBandPairingData to the caller. |
| 96 typedef base::Callback<void(const BluetoothOutOfBandPairingData& data)> | 96 typedef base::Callback<void(const BluetoothOutOfBandPairingData& data)> |
| 97 BluetoothOutOfBandPairingDataCallback; | 97 BluetoothOutOfBandPairingDataCallback; |
| 98 | 98 |
| 99 // The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX", | 99 // The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX", |
| 100 // where each XX is a hexadecimal number. | 100 // where each XX is a hexadecimal number. |
| 101 const std::string& address() const { return address_; } | 101 virtual const std::string& address() const; |
|
Mihai Parparita -not on Chrome
2012/08/17 20:30:07
Nit: lowercase names are for basic getters/setters
keybuk
2012/08/17 20:31:36
Is there any particular reason this method has bee
bryeung
2012/08/20 23:13:19
Done.
| |
| 102 | |
| 103 // The name of the adapter. | |
| 104 virtual const std::string& name() const; | |
| 102 | 105 |
| 103 // Indicates whether the adapter is actually present on the system, for | 106 // Indicates whether the adapter is actually present on the system, for |
| 104 // the default adapter this indicates whether any adapter is present. | 107 // the default adapter this indicates whether any adapter is present. |
| 105 virtual bool IsPresent() const; | 108 virtual bool IsPresent() const; |
| 106 | 109 |
| 107 // Indicates whether the adapter radio is powered. | 110 // Indicates whether the adapter radio is powered. |
| 108 virtual bool IsPowered() const; | 111 virtual bool IsPowered() const; |
| 109 | 112 |
| 110 // Requests a change to the adapter radio power, setting |powered| to true | 113 // Requests a change to the adapter radio power, setting |powered| to true |
| 111 // will turn on the radio and false will turn it off. On success, callback | 114 // will turn on the radio and false will turn it off. On success, callback |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 309 | 312 |
| 310 // Object path of adapter for this instance, this is fixed at creation time | 313 // Object path of adapter for this instance, this is fixed at creation time |
| 311 // unless |track_default_| is true in which case we update it to always | 314 // unless |track_default_| is true in which case we update it to always |
| 312 // point at the default adapter. | 315 // point at the default adapter. |
| 313 bool track_default_; | 316 bool track_default_; |
| 314 dbus::ObjectPath object_path_; | 317 dbus::ObjectPath object_path_; |
| 315 | 318 |
| 316 // Address of the adapter. | 319 // Address of the adapter. |
| 317 std::string address_; | 320 std::string address_; |
| 318 | 321 |
| 322 // Name of the adapter. | |
| 323 std::string name_; | |
| 324 | |
| 319 // Tracked adapter state, cached locally so we only send change notifications | 325 // Tracked adapter state, cached locally so we only send change notifications |
| 320 // to observers on a genuine change. | 326 // to observers on a genuine change. |
| 321 bool powered_; | 327 bool powered_; |
| 322 bool discovering_; | 328 bool discovering_; |
| 323 | 329 |
| 324 // Devices paired with, connected to, discovered by, or visible to the | 330 // Devices paired with, connected to, discovered by, or visible to the |
| 325 // adapter. The key is the Bluetooth address of the device and the value | 331 // adapter. The key is the Bluetooth address of the device and the value |
| 326 // is the BluetoothDevice object whose lifetime is managed by the adapter | 332 // is the BluetoothDevice object whose lifetime is managed by the adapter |
| 327 // instance. | 333 // instance. |
| 328 typedef std::map<const std::string, BluetoothDevice*> DevicesMap; | 334 typedef std::map<const std::string, BluetoothDevice*> DevicesMap; |
| 329 DevicesMap devices_; | 335 DevicesMap devices_; |
| 330 | 336 |
| 331 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapter); | 337 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapter); |
| 332 }; | 338 }; |
| 333 | 339 |
| 334 } // namespace chromeos | 340 } // namespace chromeos |
| 335 | 341 |
| 336 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 342 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| OLD | NEW |