Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: chromeos/dbus/fake_old_bluetooth_device_client.h

Issue 14508007: dbus: Add FakeOldBluetooth{Adapter,Device,Manager} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary lines. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/fake_old_bluetooth_device_client.h
diff --git a/chromeos/dbus/fake_old_bluetooth_device_client.h b/chromeos/dbus/fake_old_bluetooth_device_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..e957d47a994d4b2b8b81a1fc83d164f70fdde651
--- /dev/null
+++ b/chromeos/dbus/fake_old_bluetooth_device_client.h
@@ -0,0 +1,67 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_DEVICE_CLIENT_H_
+#define CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_DEVICE_CLIENT_H_
+
+#include "chromeos/dbus/bluetooth_device_client.h"
+
+namespace chromeos {
+
+// A fake implementation of BluetoothDeviceClient used on Linux desktop and for
+// tests. . This class does nothing.
+class FakeOldBluetoothDeviceClient : public BluetoothDeviceClient {
+ public:
+ struct Properties : public BluetoothDeviceClient::Properties {
+ explicit Properties(const PropertyChangedCallback& callback);
+
+ virtual ~Properties();
+
+ // BluetoothDeviceClient::Properties overrides.
+ virtual void Get(dbus::PropertyBase* property,
+ dbus::PropertySet::GetCallback callback) OVERRIDE;
+ virtual void GetAll() OVERRIDE;
+ virtual void Set(dbus::PropertyBase *property,
+ dbus::PropertySet::SetCallback callback) OVERRIDE;
+ };
+
+ FakeOldBluetoothDeviceClient();
+ virtual ~FakeOldBluetoothDeviceClient();
+
+ // BluetoothDeviceClient overrides.
+ virtual void AddObserver(Observer* observer) OVERRIDE;
+ virtual void RemoveObserver(Observer* observer) OVERRIDE;
+ virtual Properties* GetProperties(
+ const dbus::ObjectPath& object_path) OVERRIDE;
+ virtual void DiscoverServices(const dbus::ObjectPath& object_path,
+ const std::string& pattern,
+ const ServicesCallback& callback) OVERRIDE;
+ virtual void CancelDiscovery(const dbus::ObjectPath& object_path,
+ const DeviceCallback& callback) OVERRIDE;
+ virtual void Disconnect(const dbus::ObjectPath& object_path,
+ const DeviceCallback& callback) OVERRIDE;
+ virtual void CreateNode(const dbus::ObjectPath& object_path,
+ const std::string& uuid,
+ const NodeCallback& callback) OVERRIDE;
+ virtual void RemoveNode(const dbus::ObjectPath& object_path,
+ const dbus::ObjectPath& node_path,
+ const DeviceCallback& callback) OVERRIDE;
+
+ private:
+ void OnPropertyChanged(dbus::ObjectPath object_path,
+ const std::string& property_name);
+
+ // List of observers interested in event notifications from us.
+ ObserverList<Observer> observers_;
+
+ // Static properties we typedef.
+ typedef std::map<const dbus::ObjectPath, Properties *> PropertiesMap;
+ PropertiesMap properties_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeOldBluetoothDeviceClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_DEVICE_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698