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

Side by Side Diff: device/bluetooth/bluetooth_adapter_chromeos.cc

Issue 278663002: Implement chrome.bluetoothSocket.listenUsing*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix BluetoothAdapterMac include typo Created 6 years, 7 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 | Annotate | Revision Log
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 #include "device/bluetooth/bluetooth_adapter_chromeos.h" 5 #include "device/bluetooth/bluetooth_adapter_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/sequenced_task_runner.h" 12 #include "base/sequenced_task_runner.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/sys_info.h" 14 #include "base/sys_info.h"
15 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
16 #include "chromeos/dbus/bluetooth_adapter_client.h" 16 #include "chromeos/dbus/bluetooth_adapter_client.h"
17 #include "chromeos/dbus/bluetooth_agent_manager_client.h" 17 #include "chromeos/dbus/bluetooth_agent_manager_client.h"
18 #include "chromeos/dbus/bluetooth_agent_service_provider.h" 18 #include "chromeos/dbus/bluetooth_agent_service_provider.h"
19 #include "chromeos/dbus/bluetooth_device_client.h" 19 #include "chromeos/dbus/bluetooth_device_client.h"
20 #include "chromeos/dbus/bluetooth_input_client.h" 20 #include "chromeos/dbus/bluetooth_input_client.h"
21 #include "chromeos/dbus/dbus_thread_manager.h" 21 #include "chromeos/dbus/dbus_thread_manager.h"
22 #include "device/bluetooth/bluetooth_device.h" 22 #include "device/bluetooth/bluetooth_device.h"
23 #include "device/bluetooth/bluetooth_device_chromeos.h" 23 #include "device/bluetooth/bluetooth_device_chromeos.h"
24 #include "device/bluetooth/bluetooth_pairing_chromeos.h" 24 #include "device/bluetooth/bluetooth_pairing_chromeos.h"
25 #include "device/bluetooth/bluetooth_socket_chromeos.h"
25 #include "device/bluetooth/bluetooth_socket_thread.h" 26 #include "device/bluetooth/bluetooth_socket_thread.h"
27 #include "device/bluetooth/bluetooth_uuid.h"
26 #include "third_party/cros_system_api/dbus/service_constants.h" 28 #include "third_party/cros_system_api/dbus/service_constants.h"
27 29
28 using device::BluetoothAdapter; 30 using device::BluetoothAdapter;
29 using device::BluetoothDevice; 31 using device::BluetoothDevice;
32 using device::BluetoothSocket;
33 using device::BluetoothUUID;
30 34
31 namespace { 35 namespace {
32 36
33 // The agent path is relatively meaningless since BlueZ only permits one to 37 // The agent path is relatively meaningless since BlueZ only permits one to
34 // exist per D-Bus connection, it just has to be unique within Chromium. 38 // exist per D-Bus connection, it just has to be unique within Chromium.
35 const char kAgentPath[] = "/org/chromium/bluetooth_agent"; 39 const char kAgentPath[] = "/org/chromium/bluetooth_agent";
36 40
37 void OnUnregisterAgentError(const std::string& error_name, 41 void OnUnregisterAgentError(const std::string& error_name,
38 const std::string& error_message) { 42 const std::string& error_message) {
39 // It's okay if the agent didn't exist, it means we never saw an adapter. 43 // It's okay if the agent didn't exist, it means we never saw an adapter.
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 230
227 return properties->discovering.value(); 231 return properties->discovering.value();
228 } 232 }
229 233
230 void BluetoothAdapterChromeOS::ReadLocalOutOfBandPairingData( 234 void BluetoothAdapterChromeOS::ReadLocalOutOfBandPairingData(
231 const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& callback, 235 const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& callback,
232 const ErrorCallback& error_callback) { 236 const ErrorCallback& error_callback) {
233 error_callback.Run(); 237 error_callback.Run();
234 } 238 }
235 239
240 void BluetoothAdapterChromeOS::CreateRfcommService(
241 const BluetoothUUID& uuid,
242 int channel,
243 bool insecure,
244 const CreateServiceCallback& callback,
245 const CreateServiceErrorCallback& error_callback) {
246 // TODO(keybuk): implement.
247 NOTIMPLEMENTED();
248 }
249
250 void BluetoothAdapterChromeOS::CreateL2capService(
251 const BluetoothUUID& uuid,
252 int psm,
253 const CreateServiceCallback& callback,
254 const CreateServiceErrorCallback& error_callback) {
255 // TODO(keybuk): implement.
256 NOTIMPLEMENTED();
257 }
258
236 void BluetoothAdapterChromeOS::RemovePairingDelegateInternal( 259 void BluetoothAdapterChromeOS::RemovePairingDelegateInternal(
237 BluetoothDevice::PairingDelegate* pairing_delegate) { 260 BluetoothDevice::PairingDelegate* pairing_delegate) {
238 // Before removing a pairing delegate make sure that there aren't any devices 261 // Before removing a pairing delegate make sure that there aren't any devices
239 // currently using it; if there are, clear the pairing context which will 262 // currently using it; if there are, clear the pairing context which will
240 // make any responses no-ops. 263 // make any responses no-ops.
241 for (DevicesMap::iterator iter = devices_.begin(); 264 for (DevicesMap::iterator iter = devices_.begin();
242 iter != devices_.end(); ++iter) { 265 iter != devices_.end(); ++iter) {
243 BluetoothDeviceChromeOS* device_chromeos = 266 BluetoothDeviceChromeOS* device_chromeos =
244 static_cast<BluetoothDeviceChromeOS*>(iter->second); 267 static_cast<BluetoothDeviceChromeOS*>(iter->second);
245 268
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 904
882 // If the queued request resulted in a pending call, then let it 905 // If the queued request resulted in a pending call, then let it
883 // asynchonously process the remaining queued requests once the pending 906 // asynchonously process the remaining queued requests once the pending
884 // call returns. 907 // call returns.
885 if (discovery_request_pending_) 908 if (discovery_request_pending_)
886 return; 909 return;
887 } 910 }
888 } 911 }
889 912
890 } // namespace chromeos 913 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698