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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void BluetoothAdapterChromeOS::PoweredChanged(bool powered) { | 227 void BluetoothAdapterChromeOS::PoweredChanged(bool powered) { |
228 if (powered == powered_) | 228 if (powered == powered_) |
229 return; | 229 return; |
230 | 230 |
231 powered_ = powered; | 231 powered_ = powered; |
232 | 232 |
233 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 233 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
234 AdapterPoweredChanged(this, powered_)); | 234 AdapterPoweredChanged(this, powered_)); |
235 } | 235 } |
236 | 236 |
| 237 void BluetoothAdapterChromeOS::NotifyDeviceChanged( |
| 238 BluetoothDeviceChromeOS* device) { |
| 239 CHECK(device->adapter_ == this); |
| 240 |
| 241 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
| 242 DeviceChanged(this, device)); |
| 243 } |
| 244 |
237 void BluetoothAdapterChromeOS::OnStartDiscovery( | 245 void BluetoothAdapterChromeOS::OnStartDiscovery( |
238 const base::Closure& callback, | 246 const base::Closure& callback, |
239 const ErrorCallback& error_callback, | 247 const ErrorCallback& error_callback, |
240 const dbus::ObjectPath& adapter_path, | 248 const dbus::ObjectPath& adapter_path, |
241 bool success) { | 249 bool success) { |
242 if (success) { | 250 if (success) { |
243 if (discovering_count_++ == 0) { | 251 if (discovering_count_++ == 0) { |
244 VLOG(1) << object_path_.value() << ": started discovery."; | 252 VLOG(1) << object_path_.value() << ": started discovery."; |
245 | 253 |
246 // Clear devices found in previous discovery attempts | 254 // Clear devices found in previous discovery attempts |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 VLOG(1) << "Paired device " << device->GetAddress() | 531 VLOG(1) << "Paired device " << device->GetAddress() |
524 << " is no longer visible to the adapter"; | 532 << " is no longer visible to the adapter"; |
525 device->SetDiscovered(false); | 533 device->SetDiscovered(false); |
526 | 534 |
527 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 535 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
528 DeviceChanged(this, device)); | 536 DeviceChanged(this, device)); |
529 } | 537 } |
530 } | 538 } |
531 | 539 |
532 } // namespace chromeos | 540 } // namespace chromeos |
OLD | NEW |