| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/dbus/bluetooth_media_client.h" | 5 #include "device/bluetooth/dbus/bluetooth_media_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 dbus::ObjectProxy* object_proxy, | 66 dbus::ObjectProxy* object_proxy, |
| 67 const dbus::ObjectPath& object_path, | 67 const dbus::ObjectPath& object_path, |
| 68 const std::string& interface_name) override { | 68 const std::string& interface_name) override { |
| 69 return new dbus::PropertySet(object_proxy, interface_name, | 69 return new dbus::PropertySet(object_proxy, interface_name, |
| 70 base::Bind(&DoNothing)); | 70 base::Bind(&DoNothing)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void ObjectAdded(const dbus::ObjectPath& object_path, | 73 void ObjectAdded(const dbus::ObjectPath& object_path, |
| 74 const std::string& interface_name) override { | 74 const std::string& interface_name) override { |
| 75 VLOG(1) << "Remote Media added: " << object_path.value(); | 75 VLOG(1) << "Remote Media added: " << object_path.value(); |
| 76 FOR_EACH_OBSERVER(BluetoothMediaClient::Observer, observers_, | 76 for (auto& observer : observers_) |
| 77 MediaAdded(object_path)); | 77 observer.MediaAdded(object_path); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void ObjectRemoved(const dbus::ObjectPath& object_path, | 80 void ObjectRemoved(const dbus::ObjectPath& object_path, |
| 81 const std::string& interface_name) override { | 81 const std::string& interface_name) override { |
| 82 VLOG(1) << "Remote Media removed: " << object_path.value(); | 82 VLOG(1) << "Remote Media removed: " << object_path.value(); |
| 83 FOR_EACH_OBSERVER(BluetoothMediaClient::Observer, observers_, | 83 for (auto& observer : observers_) |
| 84 MediaRemoved(object_path)); | 84 observer.MediaRemoved(object_path); |
| 85 } | 85 } |
| 86 | 86 |
| 87 // BluetoothMediaClient overrides. | 87 // BluetoothMediaClient overrides. |
| 88 | 88 |
| 89 void AddObserver(BluetoothMediaClient::Observer* observer) override { | 89 void AddObserver(BluetoothMediaClient::Observer* observer) override { |
| 90 DCHECK(observer); | 90 DCHECK(observer); |
| 91 observers_.AddObserver(observer); | 91 observers_.AddObserver(observer); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void RemoveObserver(BluetoothMediaClient::Observer* observer) override { | 94 void RemoveObserver(BluetoothMediaClient::Observer* observer) override { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 BluetoothMediaClient::BluetoothMediaClient() {} | 220 BluetoothMediaClient::BluetoothMediaClient() {} |
| 221 | 221 |
| 222 BluetoothMediaClient::~BluetoothMediaClient() {} | 222 BluetoothMediaClient::~BluetoothMediaClient() {} |
| 223 | 223 |
| 224 BluetoothMediaClient* BluetoothMediaClient::Create() { | 224 BluetoothMediaClient* BluetoothMediaClient::Create() { |
| 225 return new BluetoothMediaClientImpl(); | 225 return new BluetoothMediaClientImpl(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace bluez | 228 } // namespace bluez |
| OLD | NEW |