Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: device/bluetooth/bluetooth_device_mac.h

Issue 12929003: Implemented BluetoothAdapterMac::AddDevices(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DeviceRemoved obsolete in OSX. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_DEVICE_MAC_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_
6 #define DEVICE_BLUETOOTH_BlUETOOTH_DEVICE_MAC_H_ 6 #define DEVICE_BLUETOOTH_BlUETOOTH_DEVICE_MAC_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "device/bluetooth/bluetooth_device.h" 11 #include "device/bluetooth/bluetooth_device.h"
12 12
13 #ifdef __OBJC__
14 @class IOBluetoothDevice;
15 #else
16 class IOBluetoothDevice;
17 #endif
18
13 namespace device { 19 namespace device {
14 20
15 class BluetoothDeviceMac : public BluetoothDevice { 21 class BluetoothDeviceMac : public BluetoothDevice {
16 public: 22 public:
17 BluetoothDeviceMac(); 23 explicit BluetoothDeviceMac(const IOBluetoothDevice* device);
18 virtual ~BluetoothDeviceMac(); 24 virtual ~BluetoothDeviceMac();
19 25
20 // BluetoothDevice override 26 // BluetoothDevice override
21 virtual bool IsPaired() const OVERRIDE; 27 virtual bool IsPaired() const OVERRIDE;
22 virtual const ServiceList& GetServices() const OVERRIDE; 28 virtual const ServiceList& GetServices() const OVERRIDE;
23 virtual void GetServiceRecords( 29 virtual void GetServiceRecords(
24 const ServiceRecordsCallback& callback, 30 const ServiceRecordsCallback& callback,
25 const ErrorCallback& error_callback) OVERRIDE; 31 const ErrorCallback& error_callback) OVERRIDE;
26 virtual void ProvidesServiceWithName( 32 virtual void ProvidesServiceWithName(
27 const std::string& name, 33 const std::string& name,
(...skipping 19 matching lines...) Expand all
47 const SocketCallback& callback) OVERRIDE; 53 const SocketCallback& callback) OVERRIDE;
48 virtual void SetOutOfBandPairingData( 54 virtual void SetOutOfBandPairingData(
49 const BluetoothOutOfBandPairingData& data, 55 const BluetoothOutOfBandPairingData& data,
50 const base::Closure& callback, 56 const base::Closure& callback,
51 const ErrorCallback& error_callback) OVERRIDE; 57 const ErrorCallback& error_callback) OVERRIDE;
52 virtual void ClearOutOfBandPairingData( 58 virtual void ClearOutOfBandPairingData(
53 const base::Closure& callback, 59 const base::Closure& callback,
54 const ErrorCallback& error_callback) OVERRIDE; 60 const ErrorCallback& error_callback) OVERRIDE;
55 61
56 private: 62 private:
63 friend class BluetoothAdapterMac;
64
65 // Computes the fingerprint that can be used to compare the devices.
66 static uint32 ComputeDeviceFingerprint(const IOBluetoothDevice* device);
67
68 uint32 device_fingerprint() const {
69 return device_fingerprint_;
70 }
71
72 // Used to compare the devices.
73 const uint32 device_fingerprint_;
74
57 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); 75 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac);
58 }; 76 };
59 77
60 } // namespace device 78 } // namespace device
61 79
62 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ 80 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698