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

Unified Diff: device/bluetooth/bluetooth_device_chromeos.cc

Issue 13416005: Bluetooth: clean up BluetoothDevice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make GetServices return a copy of the list Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_device_chromeos.cc
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc
index 32f4d9fd40895b049b7599d275691301d90b43d2..92a94a9c0796b668efb138cbdcec6404b3f5410c 100644
--- a/device/bluetooth/bluetooth_device_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_chromeos.cc
@@ -50,6 +50,11 @@ BluetoothDeviceChromeOS::BluetoothDeviceChromeOS(
BluetoothAdapterChromeOS* adapter)
: BluetoothDevice(),
adapter_(adapter),
+ bluetooth_class_(0),
+ paired_(false),
+ connected_(false),
+ connectable_(true),
+ connecting_(false),
pairing_delegate_(NULL),
connecting_applications_counter_(0),
connecting_calls_(0),
@@ -60,11 +65,35 @@ BluetoothDeviceChromeOS::BluetoothDeviceChromeOS(
BluetoothDeviceChromeOS::~BluetoothDeviceChromeOS() {
}
+uint32 BluetoothDeviceChromeOS::bluetooth_class() const {
+ return bluetooth_class_;
+}
+
+std::string BluetoothDeviceChromeOS::name() const {
+ return name_;
+}
+
+std::string BluetoothDeviceChromeOS::address() const {
+ return address_;
+}
+
bool BluetoothDeviceChromeOS::IsPaired() const {
- return !object_path_.value().empty();
+ return paired_;
+}
+
+bool BluetoothDeviceChromeOS::IsConnected() const {
+ return connected_;
+}
+
+bool BluetoothDeviceChromeOS::IsConnectable() const {
+ return connectable_;
+}
+
+bool BluetoothDeviceChromeOS::IsConnecting() const {
+ return connecting_;
}
-const BluetoothDevice::ServiceList&
+BluetoothDeviceChromeOS::ServiceList
BluetoothDeviceChromeOS::GetServices() const {
return service_uuids_;
}
@@ -129,7 +158,7 @@ void BluetoothDeviceChromeOS::Connect(
weak_ptr_factory_.GetWeakPtr(),
error_callback);
- if (IsPaired() || IsBonded() || IsConnected()) {
+ if (IsPaired() || IsConnected()) {
// Connection to already paired or connected device.
ConnectApplications(wrapped_callback, wrapped_error_callback);
@@ -360,9 +389,7 @@ void BluetoothDeviceChromeOS::Update(
GetServiceRecords(base::Bind(&DoNothingServiceRecordList),
base::Bind(&base::DoNothing));
- // BlueZ uses paired to mean link keys exchanged, whereas the Bluetooth
- // spec refers to this as bonded. Use the spec name for our interface.
- bonded_ = properties->paired.value();
+ paired_ = properties->paired.value();
connected_ = properties->connected.value();
}
}

Powered by Google App Engine
This is Rietveld 408576698