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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 event_router()->OnListenerRemoved(); | 98 event_router()->OnListenerRemoved(); |
99 } | 99 } |
100 | 100 |
101 namespace api { | 101 namespace api { |
102 | 102 |
103 BluetoothGetAdapterStateFunction::~BluetoothGetAdapterStateFunction() {} | 103 BluetoothGetAdapterStateFunction::~BluetoothGetAdapterStateFunction() {} |
104 | 104 |
105 bool BluetoothGetAdapterStateFunction::DoWork( | 105 bool BluetoothGetAdapterStateFunction::DoWork( |
106 scoped_refptr<BluetoothAdapter> adapter) { | 106 scoped_refptr<BluetoothAdapter> adapter) { |
107 bluetooth::AdapterState state; | 107 bluetooth::AdapterState state; |
108 PopulateAdapterState(*adapter.get(), &state); | 108 PopulateAdapterState(*adapter, &state); |
109 results_ = bluetooth::GetAdapterState::Results::Create(state); | 109 results_ = bluetooth::GetAdapterState::Results::Create(state); |
110 SendResponse(true); | 110 SendResponse(true); |
111 return true; | 111 return true; |
112 } | 112 } |
113 | 113 |
114 BluetoothGetDevicesFunction::~BluetoothGetDevicesFunction() {} | 114 BluetoothGetDevicesFunction::~BluetoothGetDevicesFunction() {} |
115 | 115 |
116 bool BluetoothGetDevicesFunction::DoWork( | 116 bool BluetoothGetDevicesFunction::DoWork( |
117 scoped_refptr<BluetoothAdapter> adapter) { | 117 scoped_refptr<BluetoothAdapter> adapter) { |
118 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 118 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
(...skipping 77 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 |