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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 void BluetoothDeviceChromeOS::ConnectToService( | 354 void BluetoothDeviceChromeOS::ConnectToService( |
355 const device::BluetoothUUID& service_uuid, | 355 const device::BluetoothUUID& service_uuid, |
356 const SocketCallback& callback) { | 356 const SocketCallback& callback) { |
357 // TODO(keybuk): implement | 357 // TODO(keybuk): implement |
358 callback.Run(scoped_refptr<device::BluetoothSocket>()); | 358 callback.Run(scoped_refptr<device::BluetoothSocket>()); |
359 } | 359 } |
360 | 360 |
361 void BluetoothDeviceChromeOS::ConnectToProfile( | 361 void BluetoothDeviceChromeOS::ConnectToProfile( |
362 device::BluetoothProfile* profile, | 362 device::BluetoothProfile* profile, |
363 const base::Closure& callback, | 363 const base::Closure& callback, |
364 const ErrorCallback& error_callback) { | 364 const ConnectToProfileErrorCallback& error_callback) { |
365 BluetoothProfileChromeOS* profile_chromeos = | 365 BluetoothProfileChromeOS* profile_chromeos = |
366 static_cast<BluetoothProfileChromeOS*>(profile); | 366 static_cast<BluetoothProfileChromeOS*>(profile); |
367 VLOG(1) << object_path_.value() << ": Connecting profile: " | 367 VLOG(1) << object_path_.value() << ": Connecting profile: " |
368 << profile_chromeos->uuid().canonical_value(); | 368 << profile_chromeos->uuid().canonical_value(); |
369 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> | 369 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
370 ConnectProfile( | 370 ConnectProfile( |
371 object_path_, | 371 object_path_, |
372 profile_chromeos->uuid().canonical_value(), | 372 profile_chromeos->uuid().canonical_value(), |
373 base::Bind( | 373 base::Bind( |
374 &BluetoothDeviceChromeOS::OnConnectProfile, | 374 &BluetoothDeviceChromeOS::OnConnectProfile, |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 const base::Closure& callback) { | 574 const base::Closure& callback) { |
575 BluetoothProfileChromeOS* profile_chromeos = | 575 BluetoothProfileChromeOS* profile_chromeos = |
576 static_cast<BluetoothProfileChromeOS*>(profile); | 576 static_cast<BluetoothProfileChromeOS*>(profile); |
577 VLOG(1) << object_path_.value() << ": Profile connected: " | 577 VLOG(1) << object_path_.value() << ": Profile connected: " |
578 << profile_chromeos->uuid().canonical_value(); | 578 << profile_chromeos->uuid().canonical_value(); |
579 callback.Run(); | 579 callback.Run(); |
580 } | 580 } |
581 | 581 |
582 void BluetoothDeviceChromeOS::OnConnectProfileError( | 582 void BluetoothDeviceChromeOS::OnConnectProfileError( |
583 device::BluetoothProfile* profile, | 583 device::BluetoothProfile* profile, |
584 const ErrorCallback& error_callback, | 584 const ConnectToProfileErrorCallback& error_callback, |
585 const std::string& error_name, | 585 const std::string& error_name, |
586 const std::string& error_message) { | 586 const std::string& error_message) { |
587 BluetoothProfileChromeOS* profile_chromeos = | 587 BluetoothProfileChromeOS* profile_chromeos = |
588 static_cast<BluetoothProfileChromeOS*>(profile); | 588 static_cast<BluetoothProfileChromeOS*>(profile); |
589 VLOG(1) << object_path_.value() << ": Profile connection failed: " | 589 VLOG(1) << object_path_.value() << ": Profile connection failed: " |
590 << profile_chromeos->uuid().canonical_value() << ": " | 590 << profile_chromeos->uuid().canonical_value() << ": " |
591 << error_name << ": " << error_message; | 591 << error_name << ": " << error_message; |
592 error_callback.Run(); | 592 error_callback.Run(error_message); |
593 } | 593 } |
594 | 594 |
595 } // namespace chromeos | 595 } // namespace chromeos |
OLD | NEW |