| Index: chromeos/dbus/fake_bluetooth_device_client.h
|
| diff --git a/chromeos/dbus/fake_bluetooth_device_client.h b/chromeos/dbus/fake_bluetooth_device_client.h
|
| index a9e6c19bec8ea6c3118adff30b262e7bcc0e80a7..4552d1dde6c4d5a2762e8f2da350e0276c5a10bd 100644
|
| --- a/chromeos/dbus/fake_bluetooth_device_client.h
|
| +++ b/chromeos/dbus/fake_bluetooth_device_client.h
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/callback.h"
|
| +#include "base/containers/scoped_ptr_map.h"
|
| #include "base/observer_list.h"
|
| #include "chromeos/chromeos_export.h"
|
| #include "chromeos/dbus/bluetooth_agent_service_provider.h"
|
| @@ -38,6 +39,26 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient
|
| dbus::PropertySet::SetCallback callback) override;
|
| };
|
|
|
| + struct SimulatedPairingOptions {
|
| + std::string pairing_method;
|
| + std::string pairing_auth_token;
|
| + };
|
| +
|
| + // Stores properties of a device that is about to be created.
|
| + struct IncomingDeviceProperties {
|
| + IncomingDeviceProperties();
|
| + ~IncomingDeviceProperties();
|
| +
|
| + std::string device_name;
|
| + std::string device_alias;
|
| + std::string device_address;
|
| + std::string device_path;
|
| + std::string pairing_method;
|
| + std::string pairing_auth_token;
|
| + int device_class = 0;
|
| + bool is_trusted = true;
|
| + };
|
| +
|
| FakeBluetoothDeviceClient();
|
| ~FakeBluetoothDeviceClient() override;
|
|
|
| @@ -86,6 +107,13 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient
|
| void CreateDevice(const dbus::ObjectPath& adapter_path,
|
| const dbus::ObjectPath& device_path);
|
|
|
| + // Creates a device with the given properties.
|
| + void CreateDeviceWithProperties(const dbus::ObjectPath& adapter_path,
|
| + const IncomingDeviceProperties& props);
|
| +
|
| + SimulatedPairingOptions* GetPairingOptions(
|
| + const dbus::ObjectPath& object_path);
|
| +
|
| // Removes a device from the set we return for the given adapter.
|
| void RemoveDevice(const dbus::ObjectPath& adapter_path,
|
| const dbus::ObjectPath& device_path);
|
| @@ -246,11 +274,18 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient
|
| // List of observers interested in event notifications from us.
|
| base::ObserverList<Observer> observers_;
|
|
|
| - // Static properties we return.
|
| - typedef std::map<const dbus::ObjectPath, Properties *> PropertiesMap;
|
| + using PropertiesMap =
|
| + base::ScopedPtrMap<const dbus::ObjectPath, scoped_ptr<Properties>>;
|
| PropertiesMap properties_map_;
|
| std::vector<dbus::ObjectPath> device_list_;
|
|
|
| + // Properties which are used to decied which method of pairing should
|
| + // be done on request.
|
| + using PairingOptionsMap =
|
| + base::ScopedPtrMap<const dbus::ObjectPath,
|
| + scoped_ptr<SimulatedPairingOptions>>;
|
| + PairingOptionsMap pairing_options_map_;
|
| +
|
| int simulation_interval_ms_;
|
| uint32_t discovery_simulation_step_;
|
| uint32_t incoming_pairing_simulation_step_;
|
|
|