OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_MANAGER_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_MANAGER_CLIENT_H_ |
| 7 |
| 8 #include "chromeos/dbus/bluetooth_manager_client.h" |
| 9 |
| 10 namespace chromeos { |
| 11 |
| 12 // A fake implementation of BluetoothManagerClient used on Linux desktop and for |
| 13 // tests. This class does nothing. |
| 14 class FakeOldBluetoothManagerClient : public BluetoothManagerClient { |
| 15 public: |
| 16 struct Properties : public BluetoothManagerClient::Properties { |
| 17 explicit Properties(const PropertyChangedCallback& callback); |
| 18 virtual ~Properties(); |
| 19 |
| 20 // BluetoothManagerClient::Properties overrides. |
| 21 virtual void Get(dbus::PropertyBase* property, |
| 22 dbus::PropertySet::GetCallback callback) OVERRIDE; |
| 23 virtual void GetAll() OVERRIDE; |
| 24 virtual void Set(dbus::PropertyBase* property, |
| 25 dbus::PropertySet::SetCallback callback) OVERRIDE; |
| 26 }; |
| 27 |
| 28 FakeOldBluetoothManagerClient(); |
| 29 virtual ~FakeOldBluetoothManagerClient(); |
| 30 |
| 31 // BluetoothManagerClient overrides. |
| 32 virtual void AddObserver(Observer* observer) OVERRIDE; |
| 33 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
| 34 virtual Properties* GetProperties() OVERRIDE; |
| 35 virtual void DefaultAdapter(const AdapterCallback& callback) OVERRIDE; |
| 36 virtual void FindAdapter(const std::string& address, |
| 37 const AdapterCallback& callback) OVERRIDE; |
| 38 |
| 39 private: |
| 40 void OnPropertyChanged(const std::string& property_name); |
| 41 |
| 42 // List of observers interested in event notifications from us. |
| 43 ObserverList<Observer> observers_; |
| 44 |
| 45 // Static properties we return. |
| 46 scoped_ptr<Properties> properties_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(FakeOldBluetoothManagerClient); |
| 49 }; |
| 50 |
| 51 } // namespace chromeos |
| 52 |
| 53 #endif // CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_MANAGER_CLIENT_H_ |
OLD | NEW |