| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_ |
| 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 11 #include "dbus/object_path.h" | 13 #include "dbus/object_path.h" |
| 12 #include "dbus/property.h" | 14 #include "dbus/property.h" |
| 13 #include "device/bluetooth/bluetooth_export.h" | 15 #include "device/bluetooth/bluetooth_export.h" |
| 14 #include "device/bluetooth/dbus/bluetooth_input_client.h" | 16 #include "device/bluetooth/dbus/bluetooth_input_client.h" |
| 15 | 17 |
| 16 namespace bluez { | 18 namespace bluez { |
| 17 | 19 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 45 // Simulate device addition/removal | 47 // Simulate device addition/removal |
| 46 void AddInputDevice(const dbus::ObjectPath& object_path); | 48 void AddInputDevice(const dbus::ObjectPath& object_path); |
| 47 void RemoveInputDevice(const dbus::ObjectPath& object_path); | 49 void RemoveInputDevice(const dbus::ObjectPath& object_path); |
| 48 | 50 |
| 49 private: | 51 private: |
| 50 // Property callback passed when we create Properties* structures. | 52 // Property callback passed when we create Properties* structures. |
| 51 void OnPropertyChanged(const dbus::ObjectPath& object_path, | 53 void OnPropertyChanged(const dbus::ObjectPath& object_path, |
| 52 const std::string& property_name); | 54 const std::string& property_name); |
| 53 | 55 |
| 54 // Static properties we return. | 56 // Static properties we return. |
| 55 typedef std::map<const dbus::ObjectPath, Properties*> PropertiesMap; | 57 std::map<const dbus::ObjectPath, std::unique_ptr<Properties>> properties_map_; |
| 56 PropertiesMap properties_map_; | |
| 57 | 58 |
| 58 // List of observers interested in event notifications from us. | 59 // List of observers interested in event notifications from us. |
| 59 base::ObserverList<Observer> observers_; | 60 base::ObserverList<Observer> observers_; |
| 60 | 61 |
| 61 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothInputClient); | 62 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothInputClient); |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace bluez | 65 } // namespace bluez |
| 65 | 66 |
| 66 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_ | 67 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_INPUT_CLIENT_H_ |
| OLD | NEW |