OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_adapter_chromeos.h" | 5 #include "device/bluetooth/bluetooth_adapter_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 void BluetoothAdapterChromeOS::PoweredChanged(bool powered) { | 238 void BluetoothAdapterChromeOS::PoweredChanged(bool powered) { |
239 if (powered == powered_) | 239 if (powered == powered_) |
240 return; | 240 return; |
241 | 241 |
242 powered_ = powered; | 242 powered_ = powered; |
243 | 243 |
244 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 244 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
245 AdapterPoweredChanged(this, powered_)); | 245 AdapterPoweredChanged(this, powered_)); |
246 } | 246 } |
247 | 247 |
248 void BluetoothAdapterChromeOS::DeviceChanged(BluetoothDeviceChromeOS* device) { | |
249 CHECK(device->adapter_ == this); | |
250 | |
251 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | |
252 DeviceChanged(this, device)); | |
keybuk
2013/04/18 00:52:24
There are other instances of this code in Bluetoot
deymo
2013/04/18 01:38:40
In a deprecated implementation? It is worth the re
keybuk
2013/04/18 15:54:17
Yes.
deymo
2013/04/19 01:40:30
Done.
| |
253 } | |
254 | |
248 void BluetoothAdapterChromeOS::OnStartDiscovery( | 255 void BluetoothAdapterChromeOS::OnStartDiscovery( |
249 const base::Closure& callback, | 256 const base::Closure& callback, |
250 const ErrorCallback& error_callback, | 257 const ErrorCallback& error_callback, |
251 const dbus::ObjectPath& adapter_path, | 258 const dbus::ObjectPath& adapter_path, |
252 bool success) { | 259 bool success) { |
253 if (success) { | 260 if (success) { |
254 if (discovering_count_++ == 0) { | 261 if (discovering_count_++ == 0) { |
255 DVLOG(1) << object_path_.value() << ": started discovery."; | 262 DVLOG(1) << object_path_.value() << ": started discovery."; |
256 | 263 |
257 // Clear devices found in previous discovery attempts | 264 // Clear devices found in previous discovery attempts |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 DVLOG(1) << "Paired device " << device->address() | 547 DVLOG(1) << "Paired device " << device->address() |
541 << " is no longer visible to the adapter"; | 548 << " is no longer visible to the adapter"; |
542 device->SetVisible(false); | 549 device->SetVisible(false); |
543 | 550 |
544 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 551 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
545 DeviceChanged(this, device)); | 552 DeviceChanged(this, device)); |
546 } | 553 } |
547 } | 554 } |
548 | 555 |
549 } // namespace chromeos | 556 } // namespace chromeos |
OLD | NEW |