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

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

Issue 1057603004: bluetooth: Refactor (Add|Remove)Observer impls into BluetoothAdapter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-style-guide-ordering-
Patch Set: Merge TOT Created 5 years, 8 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 <IOKit/IOReturn.h> 8 #include <IOKit/IOReturn.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 23 matching lines...) Expand all
34 34
35 class BluetoothAdapterMacTest; 35 class BluetoothAdapterMacTest;
36 36
37 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac 37 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
38 : public BluetoothAdapter, 38 : public BluetoothAdapter,
39 public BluetoothDiscoveryManagerMac::Observer { 39 public BluetoothDiscoveryManagerMac::Observer {
40 public: 40 public:
41 static base::WeakPtr<BluetoothAdapter> CreateAdapter(); 41 static base::WeakPtr<BluetoothAdapter> CreateAdapter();
42 42
43 // BluetoothAdapter: 43 // BluetoothAdapter:
44 void AddObserver(BluetoothAdapter::Observer* observer) override;
45 void RemoveObserver(BluetoothAdapter::Observer* observer) override;
46 std::string GetAddress() const override; 44 std::string GetAddress() const override;
47 std::string GetName() const override; 45 std::string GetName() const override;
48 void SetName(const std::string& name, 46 void SetName(const std::string& name,
49 const base::Closure& callback, 47 const base::Closure& callback,
50 const ErrorCallback& error_callback) override; 48 const ErrorCallback& error_callback) override;
51 bool IsInitialized() const override; 49 bool IsInitialized() const override;
52 bool IsPresent() const override; 50 bool IsPresent() const override;
53 bool IsPowered() const override; 51 bool IsPowered() const override;
54 void SetPowered(bool powered, 52 void SetPowered(bool powered,
55 const base::Closure& callback, 53 const base::Closure& callback,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 std::string name_; 120 std::string name_;
123 bool powered_; 121 bool powered_;
124 122
125 int num_discovery_sessions_; 123 int num_discovery_sessions_;
126 124
127 // Discovery manager for Bluetooth Classic. 125 // Discovery manager for Bluetooth Classic.
128 scoped_ptr<BluetoothDiscoveryManagerMac> classic_discovery_manager_; 126 scoped_ptr<BluetoothDiscoveryManagerMac> classic_discovery_manager_;
129 127
130 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; 128 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
131 129
132 // List of observers interested in event notifications from us.
133 ObserverList<BluetoothAdapter::Observer> observers_;
134
135 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; 130 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_;
136 131
137 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); 132 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac);
138 }; 133 };
139 134
140 } // namespace device 135 } // namespace device
141 136
142 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ 137 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos.cc ('k') | device/bluetooth/bluetooth_adapter_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698