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

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: 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 BluetoothDeviceMac(const IOBluetoothDevice* device);
Mark Mentovai 2013/03/19 16:04:35 This constructor must be explicit now that you’re
youngki 2013/03/19 19:04:55 Done.
18 virtual ~BluetoothDeviceMac(); 24 virtual ~BluetoothDeviceMac();
19 25
26 void SetVisible(bool visible);
Mark Mentovai 2013/03/19 16:04:35 Shouldn’t this be private? You only need to call t
youngki 2013/03/19 19:04:55 Removed this function since it is no longer necess
27
20 // BluetoothDevice override 28 // BluetoothDevice override
21 virtual bool IsPaired() const OVERRIDE; 29 virtual bool IsPaired() const OVERRIDE;
22 virtual const ServiceList& GetServices() const OVERRIDE; 30 virtual const ServiceList& GetServices() const OVERRIDE;
23 virtual void GetServiceRecords( 31 virtual void GetServiceRecords(
24 const ServiceRecordsCallback& callback, 32 const ServiceRecordsCallback& callback,
25 const ErrorCallback& error_callback) OVERRIDE; 33 const ErrorCallback& error_callback) OVERRIDE;
26 virtual void ProvidesServiceWithName( 34 virtual void ProvidesServiceWithName(
27 const std::string& name, 35 const std::string& name,
28 const ProvidesServiceCallback& callback) OVERRIDE; 36 const ProvidesServiceCallback& callback) OVERRIDE;
29 virtual bool ExpectingPinCode() const OVERRIDE; 37 virtual bool ExpectingPinCode() const OVERRIDE;
(...skipping 17 matching lines...) Expand all
47 const SocketCallback& callback) OVERRIDE; 55 const SocketCallback& callback) OVERRIDE;
48 virtual void SetOutOfBandPairingData( 56 virtual void SetOutOfBandPairingData(
49 const BluetoothOutOfBandPairingData& data, 57 const BluetoothOutOfBandPairingData& data,
50 const base::Closure& callback, 58 const base::Closure& callback,
51 const ErrorCallback& error_callback) OVERRIDE; 59 const ErrorCallback& error_callback) OVERRIDE;
52 virtual void ClearOutOfBandPairingData( 60 virtual void ClearOutOfBandPairingData(
53 const base::Closure& callback, 61 const base::Closure& callback,
54 const ErrorCallback& error_callback) OVERRIDE; 62 const ErrorCallback& error_callback) OVERRIDE;
55 63
56 private: 64 private:
65 friend class BluetoothAdapterMac;
66
67 // Computes the fingerprint that can be used to compare the devices.
68 static uint32 ComputeDeviceFingerprint(const IOBluetoothDevice* device);
69
70 uint32 device_fingerprint() const {
71 return device_fingerprint_;
72 }
73
74 // Used to compare the devices.
75 const uint32 device_fingerprint_;
76
57 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); 77 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac);
58 }; 78 };
59 79
60 } // namespace device 80 } // namespace device
61 81
62 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ 82 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698