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_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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 : public device::BluetoothAdapter, | 35 : public device::BluetoothAdapter, |
36 public BluetoothManagerClient::Observer, | 36 public BluetoothManagerClient::Observer, |
37 public BluetoothAdapterClient::Observer, | 37 public BluetoothAdapterClient::Observer, |
38 public BluetoothDeviceClient::Observer { | 38 public BluetoothDeviceClient::Observer { |
39 public: | 39 public: |
40 // BluetoothAdapter override | 40 // BluetoothAdapter override |
41 virtual void AddObserver( | 41 virtual void AddObserver( |
42 device::BluetoothAdapter::Observer* observer) OVERRIDE; | 42 device::BluetoothAdapter::Observer* observer) OVERRIDE; |
43 virtual void RemoveObserver( | 43 virtual void RemoveObserver( |
44 device::BluetoothAdapter::Observer* observer) OVERRIDE; | 44 device::BluetoothAdapter::Observer* observer) OVERRIDE; |
| 45 virtual std::string address() const OVERRIDE; |
| 46 virtual std::string name() const OVERRIDE; |
45 virtual bool IsInitialized() const OVERRIDE; | 47 virtual bool IsInitialized() const OVERRIDE; |
46 virtual bool IsPresent() const OVERRIDE; | 48 virtual bool IsPresent() const OVERRIDE; |
47 virtual bool IsPowered() const OVERRIDE; | 49 virtual bool IsPowered() const OVERRIDE; |
48 virtual void SetPowered( | 50 virtual void SetPowered( |
49 bool powered, | 51 bool powered, |
50 const base::Closure& callback, | 52 const base::Closure& callback, |
51 const ErrorCallback& error_callback) OVERRIDE; | 53 const ErrorCallback& error_callback) OVERRIDE; |
52 virtual bool IsDiscovering() const OVERRIDE; | 54 virtual bool IsDiscovering() const OVERRIDE; |
53 virtual void StartDiscovering( | 55 virtual void StartDiscovering( |
54 const base::Closure& callback, | 56 const base::Closure& callback, |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 209 |
208 // List of observers interested in event notifications from us. | 210 // List of observers interested in event notifications from us. |
209 ObserverList<device::BluetoothAdapter::Observer> observers_; | 211 ObserverList<device::BluetoothAdapter::Observer> observers_; |
210 | 212 |
211 // Object path of adapter for this instance, we update it to always | 213 // Object path of adapter for this instance, we update it to always |
212 // point at the default adapter. | 214 // point at the default adapter. |
213 dbus::ObjectPath object_path_; | 215 dbus::ObjectPath object_path_; |
214 | 216 |
215 // Tracked adapter state, cached locally so we only send change notifications | 217 // Tracked adapter state, cached locally so we only send change notifications |
216 // to observers on a genuine change. | 218 // to observers on a genuine change. |
| 219 std::string address_; |
| 220 std::string name_; |
217 bool powered_; | 221 bool powered_; |
218 bool discovering_; | 222 bool discovering_; |
219 | 223 |
220 // Count of callers to StartDiscovering() and StopDiscovering(), used to | 224 // Count of callers to StartDiscovering() and StopDiscovering(), used to |
221 // track whether to clear the discovered devices list on start. | 225 // track whether to clear the discovered devices list on start. |
222 int discovering_count_; | 226 int discovering_count_; |
223 | 227 |
224 // Note: This should remain the last member so it'll be destroyed and | 228 // Note: This should remain the last member so it'll be destroyed and |
225 // invalidate its weak pointers before any other members are destroyed. | 229 // invalidate its weak pointers before any other members are destroyed. |
226 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; | 230 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; |
227 | 231 |
228 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); | 232 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); |
229 }; | 233 }; |
230 | 234 |
231 } // namespace chromeos | 235 } // namespace chromeos |
232 | 236 |
233 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 237 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
OLD | NEW |