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

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: More win visible fixes 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
« no previous file with comments | « device/bluetooth/bluetooth_device_chromeos.h ('k') | device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0d87b18694a17de8966d7674aee1cba8e931c8e8 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::GetBluetoothClass() const {
+ return bluetooth_class_;
+}
+
+std::string BluetoothDeviceChromeOS::GetDeviceName() const {
+ return name_;
+}
+
+std::string BluetoothDeviceChromeOS::GetAddress() 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);
@@ -301,7 +330,7 @@ void BluetoothDeviceChromeOS::SetOutOfBandPairingData(
DBusThreadManager::Get()->GetBluetoothOutOfBandClient()->
AddRemoteData(
object_path_,
- address(),
+ address_,
data,
base::Bind(&BluetoothDeviceChromeOS::OnRemoteDataCallback,
weak_ptr_factory_.GetWeakPtr(),
@@ -315,7 +344,7 @@ void BluetoothDeviceChromeOS::ClearOutOfBandPairingData(
DBusThreadManager::Get()->GetBluetoothOutOfBandClient()->
RemoveRemoteData(
object_path_,
- address(),
+ address_,
base::Bind(&BluetoothDeviceChromeOS::OnRemoteDataCallback,
weak_ptr_factory_.GetWeakPtr(),
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();
}
}
@@ -454,7 +481,7 @@ void BluetoothDeviceChromeOS::CollectServiceRecordsCallback(
for (BluetoothDeviceClient::ServiceMap::const_iterator i =
service_map.begin(); i != service_map.end(); ++i) {
service_records_.push_back(
- new BluetoothServiceRecordChromeOS(address(), i->second));
+ new BluetoothServiceRecordChromeOS(address_, i->second));
}
service_records_loaded_ = true;
« no previous file with comments | « device/bluetooth/bluetooth_device_chromeos.h ('k') | device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698