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

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

Issue 12929003: Implemented BluetoothAdapterMac::AddDevices(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: used pairedDevices instead of recentDevices 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_ADAPTER_MAC_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/observer_list.h" 12 #include "base/observer_list.h"
13 #include "device/bluetooth/bluetooth_adapter.h" 13 #include "device/bluetooth/bluetooth_adapter.h"
14 14
15 #ifdef __OBJC__
16 @class NSArray;
17 #else
18 class NSArray;
19 #endif
20
15 namespace base { 21 namespace base {
16 22
17 class SequencedTaskRunner; 23 class SequencedTaskRunner;
18 24
19 } // namespace base 25 } // namespace base
20 26
21 namespace device { 27 namespace device {
22 28
23 class BluetoothAdapterMacTest; 29 class BluetoothAdapterMacTest;
24 30
(...skipping 27 matching lines...) Expand all
52 friend class BluetoothAdapterMacTest; 58 friend class BluetoothAdapterMacTest;
53 59
54 BluetoothAdapterMac(); 60 BluetoothAdapterMac();
55 virtual ~BluetoothAdapterMac(); 61 virtual ~BluetoothAdapterMac();
56 62
57 void TrackDefaultAdapter(); 63 void TrackDefaultAdapter();
58 void TrackTestAdapter( 64 void TrackTestAdapter(
59 scoped_refptr<base::SequencedTaskRunner> ui_task_runner); 65 scoped_refptr<base::SequencedTaskRunner> ui_task_runner);
60 void PollAdapter(); 66 void PollAdapter();
61 67
68 // Updates |devices_| to be consistent with |devices| and notifies observers
69 // of the changes.
70 // |devices| is an array of pointers to |IOBluetoothDevice| objects.
71 void UpdateDevices(NSArray* devices);
Mark Mentovai 2013/03/20 19:01:16 I like keeping the naming consistent. The new meth
youngki 2013/03/20 20:30:50 Actually I am going to use this method to add disc
72
73 // Remove any unpaired devices (i.e. devices that are not in |paired_devices|)
74 // from |devices_|.
75 // |devices| is an array of pointers to paired |IOBluetoothDevice| objects.
76 void RemoveUnpairedDevices(NSArray* paired_devices);
77
62 bool powered_; 78 bool powered_;
63 79
64 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; 80 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
65 81
66 // List of observers interested in event notifications from us. 82 // List of observers interested in event notifications from us.
67 ObserverList<BluetoothAdapter::Observer> observers_; 83 ObserverList<BluetoothAdapter::Observer> observers_;
68 84
69 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; 85 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_;
70 86
71 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); 87 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac);
72 }; 88 };
73 89
74 } // namespace device 90 } // namespace device
75 91
76 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ 92 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698