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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // Requests that the adapter begin discovering new devices, code must | 115 // Requests that the adapter begin discovering new devices, code must |
116 // always call this method if they require the adapter be in discovery | 116 // always call this method if they require the adapter be in discovery |
117 // and should not make it conditional on the value of IsDiscovering() | 117 // and should not make it conditional on the value of IsDiscovering() |
118 // as other adapter users may be making the same request. Code must also | 118 // as other adapter users may be making the same request. Code must also |
119 // call StopDiscovering() when done. On success |callback| will be called, | 119 // call StopDiscovering() when done. On success |callback| will be called, |
120 // on failure |error_callback| will be called instead. | 120 // on failure |error_callback| will be called instead. |
121 // | 121 // |
122 // Since discovery may already be in progress when this method is called, | 122 // Since discovery may already be in progress when this method is called, |
123 // callers should retrieve the current set of discovered devices by calling | 123 // callers should retrieve the current set of discovered devices by calling |
124 // GetDevices() and checking for those with IsVisible() as true. | 124 // GetDevices() and checking for those with IsPaired() as false. |
125 virtual void StartDiscovering(const base::Closure& callback, | 125 virtual void StartDiscovering(const base::Closure& callback, |
126 const ErrorCallback& error_callback) = 0; | 126 const ErrorCallback& error_callback) = 0; |
127 | 127 |
128 // Requests that an earlier call to StartDiscovering() be cancelled; the | 128 // Requests that an earlier call to StartDiscovering() be cancelled; the |
129 // adapter may not actually cease discovering devices if other callers | 129 // adapter may not actually cease discovering devices if other callers |
130 // have called StartDiscovering() and not yet called this method. On | 130 // have called StartDiscovering() and not yet called this method. On |
131 // success |callback| will be called, on failure |error_callback| will be | 131 // success |callback| will be called, on failure |error_callback| will be |
132 // called instead. | 132 // called instead. |
133 virtual void StopDiscovering(const base::Closure& callback, | 133 virtual void StopDiscovering(const base::Closure& callback, |
134 const ErrorCallback& error_callback) = 0; | 134 const ErrorCallback& error_callback) = 0; |
(...skipping 26 matching lines...) Expand all Loading... |
161 // adapter. The key is the Bluetooth address of the device and the value | 161 // adapter. The key is the Bluetooth address of the device and the value |
162 // is the BluetoothDevice object whose lifetime is managed by the | 162 // is the BluetoothDevice object whose lifetime is managed by the |
163 // adapter instance. | 163 // adapter instance. |
164 typedef std::map<const std::string, BluetoothDevice*> DevicesMap; | 164 typedef std::map<const std::string, BluetoothDevice*> DevicesMap; |
165 DevicesMap devices_; | 165 DevicesMap devices_; |
166 }; | 166 }; |
167 | 167 |
168 } // namespace device | 168 } // namespace device |
169 | 169 |
170 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 170 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |