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_device_chromeos.h" | 5 #include "device/bluetooth/bluetooth_device_chromeos.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 void BluetoothDeviceChromeOS::ConnectToService( | 346 void BluetoothDeviceChromeOS::ConnectToService( |
347 const std::string& service_uuid, | 347 const std::string& service_uuid, |
348 const SocketCallback& callback) { | 348 const SocketCallback& callback) { |
349 // TODO(keybuk): implement | 349 // TODO(keybuk): implement |
350 callback.Run(scoped_refptr<device::BluetoothSocket>()); | 350 callback.Run(scoped_refptr<device::BluetoothSocket>()); |
351 } | 351 } |
352 | 352 |
353 void BluetoothDeviceChromeOS::ConnectToProfile( | 353 void BluetoothDeviceChromeOS::ConnectToProfile( |
354 device::BluetoothProfile* profile, | 354 device::BluetoothProfile* profile, |
355 const base::Closure& callback, | 355 const base::Closure& callback, |
356 const ErrorCallback& error_callback) { | 356 const ConnectToProfileErrorCallback& error_callback) { |
357 BluetoothProfileChromeOS* profile_chromeos = | 357 BluetoothProfileChromeOS* profile_chromeos = |
358 static_cast<BluetoothProfileChromeOS*>(profile); | 358 static_cast<BluetoothProfileChromeOS*>(profile); |
359 VLOG(1) << object_path_.value() << ": Connecting profile: " | 359 VLOG(1) << object_path_.value() << ": Connecting profile: " |
360 << profile_chromeos->uuid(); | 360 << profile_chromeos->uuid(); |
361 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> | 361 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
362 ConnectProfile( | 362 ConnectProfile( |
363 object_path_, | 363 object_path_, |
364 profile_chromeos->uuid(), | 364 profile_chromeos->uuid(), |
365 base::Bind( | 365 base::Bind( |
366 &BluetoothDeviceChromeOS::OnConnectProfile, | 366 &BluetoothDeviceChromeOS::OnConnectProfile, |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 const base::Closure& callback) { | 566 const base::Closure& callback) { |
567 BluetoothProfileChromeOS* profile_chromeos = | 567 BluetoothProfileChromeOS* profile_chromeos = |
568 static_cast<BluetoothProfileChromeOS*>(profile); | 568 static_cast<BluetoothProfileChromeOS*>(profile); |
569 VLOG(1) << object_path_.value() << ": Profile connected: " | 569 VLOG(1) << object_path_.value() << ": Profile connected: " |
570 << profile_chromeos->uuid(); | 570 << profile_chromeos->uuid(); |
571 callback.Run(); | 571 callback.Run(); |
572 } | 572 } |
573 | 573 |
574 void BluetoothDeviceChromeOS::OnConnectProfileError( | 574 void BluetoothDeviceChromeOS::OnConnectProfileError( |
575 device::BluetoothProfile* profile, | 575 device::BluetoothProfile* profile, |
576 const ErrorCallback& error_callback, | 576 const ConnectToProfileErrorCallback& error_callback, |
577 const std::string& error_name, | 577 const std::string& error_name, |
578 const std::string& error_message) { | 578 const std::string& error_message) { |
579 BluetoothProfileChromeOS* profile_chromeos = | 579 BluetoothProfileChromeOS* profile_chromeos = |
580 static_cast<BluetoothProfileChromeOS*>(profile); | 580 static_cast<BluetoothProfileChromeOS*>(profile); |
581 VLOG(1) << object_path_.value() << ": Profile connection failed: " | 581 VLOG(1) << object_path_.value() << ": Profile connection failed: " |
582 << profile_chromeos->uuid() << ": " | 582 << profile_chromeos->uuid() << ": " |
583 << error_name << ": " << error_message; | 583 << error_name << ": " << error_message; |
584 error_callback.Run(); | 584 error_callback.Run(error_message); |
585 } | 585 } |
586 | 586 |
587 } // namespace chromeos | 587 } // namespace chromeos |
OLD | NEW |