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

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

Issue 9694054: bluetooth: implement device pairing support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: [clang] use POD for constants to avoid exit-time destructor error Created 8 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: 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 79eb75469959a01935694310f69345fd2f7ab935..ac18cd5d7f7e34f68291bde6a9dcae885442faf1 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc
@@ -287,7 +287,7 @@ void BluetoothAdapter::UpdateDevice(const dbus::ObjectPath& device_path) {
// Device has an address and was not previously known, add to the map
// and notify observers.
- BluetoothDevice* device = BluetoothDevice::CreateBound(device_path,
+ BluetoothDevice* device = BluetoothDevice::CreateBound(this, device_path,
properties);
devices_[address] = device;
@@ -304,6 +304,14 @@ BluetoothAdapter::DeviceList BluetoothAdapter::GetDevices() {
return devices;
}
+BluetoothDevice* BluetoothAdapter::GetDevice(const std::string& address) {
+ DevicesMap::iterator iter = devices_.find(address);
+ if (iter != devices_.end())
+ return iter->second;
+
+ return NULL;
+}
+
void BluetoothAdapter::ClearDevices() {
for (DevicesMap::iterator iter = devices_.begin();
iter != devices_.end(); ++iter) {
@@ -381,7 +389,7 @@ void BluetoothAdapter::DeviceFound(
BluetoothDevice* device;
DevicesMap::iterator iter = devices_.find(address);
if (iter == devices_.end()) {
- device = BluetoothDevice::CreateUnbound(&properties);
+ device = BluetoothDevice::CreateUnbound(this, &properties);
devices_[address] = device;
if (device->IsSupported())

Powered by Google App Engine
This is Rietveld 408576698