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

Unified Diff: chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc

Issue 10837294: Add bluetooth.getName API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc
index 82b773f335d60d377a1597271eedcd794c4c5358..d64f02e08306925d024aa04fccdeba3cfd786142 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc
@@ -63,6 +63,14 @@ void BluetoothAdapter::RemoveObserver(Observer* observer) {
observers_.RemoveObserver(observer);
}
+const std::string& BluetoothAdapter::address() const {
+ return address_;
+}
+
+const std::string& BluetoothAdapter::name() const {
+ return name_;
+}
+
bool BluetoothAdapter::IsPresent() const {
return !object_path_.value().empty();
}
@@ -216,6 +224,7 @@ void BluetoothAdapter::ChangeAdapter(const dbus::ObjectPath& adapter_path) {
GetProperties(object_path_);
address_ = properties->address.value();
+ name_ = properties->name.value();
PoweredChanged(properties->powered.value());
DiscoveringChanged(properties->discovering.value());
@@ -236,6 +245,7 @@ void BluetoothAdapter::RemoveAdapter() {
object_path_ = dbus::ObjectPath("");
address_.clear();
+ name_.clear();
FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
AdapterPresentChanged(this, false));
@@ -335,6 +345,9 @@ void BluetoothAdapter::AdapterPropertyChanged(
} else if (property_name == properties->address.name()) {
address_ = properties->address.value();
+ } else if (property_name == properties->name.name()) {
+ name_ = properties->name.value();
+
}
}

Powered by Google App Engine
This is Rietveld 408576698