| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_LE_ADVERTISING_MANAGER_CLIENT_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ |
| 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 const ErrorCallback& error_callback) override; | 54 const ErrorCallback& error_callback) override; |
| 55 | 55 |
| 56 // Register, unregister and retrieve pointers to profile server providers. | 56 // Register, unregister and retrieve pointers to profile server providers. |
| 57 void RegisterAdvertisementServiceProvider( | 57 void RegisterAdvertisementServiceProvider( |
| 58 FakeBluetoothLEAdvertisementServiceProvider* service_provider); | 58 FakeBluetoothLEAdvertisementServiceProvider* service_provider); |
| 59 void UnregisterAdvertisementServiceProvider( | 59 void UnregisterAdvertisementServiceProvider( |
| 60 FakeBluetoothLEAdvertisementServiceProvider* service_provider); | 60 FakeBluetoothLEAdvertisementServiceProvider* service_provider); |
| 61 FakeBluetoothLEAdvertisementServiceProvider* GetAdvertisementServiceProvider( | 61 FakeBluetoothLEAdvertisementServiceProvider* GetAdvertisementServiceProvider( |
| 62 const std::string& uuid); | 62 const std::string& uuid); |
| 63 | 63 |
| 64 int currently_registered() { return currently_registered_.size(); } |
| 65 |
| 66 enum : size_t { kMaxBluezAdvertisements = 5 }; |
| 67 |
| 64 private: | 68 private: |
| 65 // Map of a D-Bus object path to the FakeBluetoothAdvertisementServiceProvider | 69 // Map of a D-Bus object path to the FakeBluetoothAdvertisementServiceProvider |
| 66 // registered for it; maintained by RegisterAdvertisementServiceProvider() and | 70 // registered for it; maintained by RegisterAdvertisementServiceProvider() and |
| 67 // UnregisterProfileServiceProvicer() called by the constructor and | 71 // UnregisterProfileServiceProvicer() called by the constructor and |
| 68 // destructor of FakeBluetoothAdvertisementServiceProvider. | 72 // destructor of FakeBluetoothAdvertisementServiceProvider. |
| 69 typedef std::map<dbus::ObjectPath, | 73 typedef std::map<dbus::ObjectPath, |
| 70 FakeBluetoothLEAdvertisementServiceProvider*> | 74 FakeBluetoothLEAdvertisementServiceProvider*> |
| 71 ServiceProviderMap; | 75 ServiceProviderMap; |
| 72 ServiceProviderMap service_provider_map_; | 76 ServiceProviderMap service_provider_map_; |
| 73 | 77 |
| 74 // Holds the currently registered advertisement. If there is no advertisement | 78 // Holds currently registered advertisements. |
| 75 // registered, this path is empty. | 79 std::vector<dbus::ObjectPath> currently_registered_; |
| 76 dbus::ObjectPath currently_registered_; | |
| 77 | 80 |
| 78 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothLEAdvertisingManagerClient); | 81 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothLEAdvertisingManagerClient); |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 } // namespace bluez | 84 } // namespace bluez |
| 82 | 85 |
| 83 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ | 86 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ |
| OLD | NEW |