| OLD | NEW |
| 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 #include "device/bluetooth/bluetooth_adapter_mac.h" | 5 #include "device/bluetooth/bluetooth_adapter_mac.h" |
| 6 | 6 |
| 7 #import <IOBluetooth/objc/IOBluetoothDevice.h> | 7 #import <IOBluetooth/objc/IOBluetoothDevice.h> |
| 8 #import <IOBluetooth/objc/IOBluetoothHostController.h> | 8 #import <IOBluetooth/objc/IOBluetoothHostController.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void BluetoothAdapterMac::AddObserver(BluetoothAdapter::Observer* observer) { | 55 void BluetoothAdapterMac::AddObserver(BluetoothAdapter::Observer* observer) { |
| 56 DCHECK(observer); | 56 DCHECK(observer); |
| 57 observers_.AddObserver(observer); | 57 observers_.AddObserver(observer); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void BluetoothAdapterMac::RemoveObserver(BluetoothAdapter::Observer* observer) { | 60 void BluetoothAdapterMac::RemoveObserver(BluetoothAdapter::Observer* observer) { |
| 61 DCHECK(observer); | 61 DCHECK(observer); |
| 62 observers_.RemoveObserver(observer); | 62 observers_.RemoveObserver(observer); |
| 63 } | 63 } |
| 64 | 64 |
| 65 std::string BluetoothAdapterMac::address() const { |
| 66 return address_; |
| 67 } |
| 68 |
| 69 std::string BluetoothAdapterMac::name() const { |
| 70 return name_; |
| 71 } |
| 72 |
| 65 bool BluetoothAdapterMac::IsInitialized() const { | 73 bool BluetoothAdapterMac::IsInitialized() const { |
| 66 return true; | 74 return true; |
| 67 } | 75 } |
| 68 | 76 |
| 69 bool BluetoothAdapterMac::IsPresent() const { | 77 bool BluetoothAdapterMac::IsPresent() const { |
| 70 return !address_.empty(); | 78 return !address_.empty(); |
| 71 } | 79 } |
| 72 | 80 |
| 73 bool BluetoothAdapterMac::IsPowered() const { | 81 bool BluetoothAdapterMac::IsPowered() const { |
| 74 return powered_; | 82 return powered_; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 if (device_iter->second->IsPaired()) { | 198 if (device_iter->second->IsPaired()) { |
| 191 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 199 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
| 192 DeviceRemoved(this, device_iter->second)); | 200 DeviceRemoved(this, device_iter->second)); |
| 193 delete device_iter->second; | 201 delete device_iter->second; |
| 194 devices_.erase(device_iter); | 202 devices_.erase(device_iter); |
| 195 } | 203 } |
| 196 } | 204 } |
| 197 } | 205 } |
| 198 | 206 |
| 199 } // namespace device | 207 } // namespace device |
| OLD | NEW |