OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "extensions/browser/api/bluetooth/bluetooth_api.h" | 5 #include "extensions/browser/api/bluetooth/bluetooth_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 BluetoothAdapter::DeviceList devices = adapter->GetDevices(); | 122 BluetoothAdapter::DeviceList devices = adapter->GetDevices(); |
123 for (BluetoothAdapter::DeviceList::const_iterator iter = devices.begin(); | 123 for (BluetoothAdapter::DeviceList::const_iterator iter = devices.begin(); |
124 iter != devices.end(); | 124 iter != devices.end(); |
125 ++iter) { | 125 ++iter) { |
126 const BluetoothDevice* device = *iter; | 126 const BluetoothDevice* device = *iter; |
127 DCHECK(device); | 127 DCHECK(device); |
128 | 128 |
129 bluetooth::Device extension_device; | 129 bluetooth::Device extension_device; |
130 bluetooth::BluetoothDeviceToApiDevice(*device, &extension_device); | 130 bluetooth::BluetoothDeviceToApiDevice(*device, &extension_device); |
131 | 131 |
132 device_list->Append(extension_device.ToValue().release()); | 132 device_list->Append(extension_device.ToValue()); |
133 } | 133 } |
134 | 134 |
135 SetResult(std::move(device_list)); | 135 SetResult(std::move(device_list)); |
136 SendResponse(true); | 136 SendResponse(true); |
137 | 137 |
138 return true; | 138 return true; |
139 } | 139 } |
140 | 140 |
141 BluetoothGetDeviceFunction::~BluetoothGetDeviceFunction() {} | 141 BluetoothGetDeviceFunction::~BluetoothGetDeviceFunction() {} |
142 | 142 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 ->StopDiscoverySession( | 196 ->StopDiscoverySession( |
197 adapter.get(), GetExtensionId(), | 197 adapter.get(), GetExtensionId(), |
198 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), | 198 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), |
199 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); | 199 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); |
200 | 200 |
201 return true; | 201 return true; |
202 } | 202 } |
203 | 203 |
204 } // namespace api | 204 } // namespace api |
205 } // namespace extensions | 205 } // namespace extensions |
OLD | NEW |