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

Unified Diff: chromeos/dbus/fake_bluetooth_agent_service_provider.h

Issue 13927010: Bluetooth: implement BlueZ 5 backend for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix review comment 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_bluetooth_agent_service_provider.h
diff --git a/chromeos/dbus/fake_bluetooth_agent_service_provider.h b/chromeos/dbus/fake_bluetooth_agent_service_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..23f232e36e57fdcc88d27cd76256e4e486e24b01
--- /dev/null
+++ b/chromeos/dbus/fake_bluetooth_agent_service_provider.h
@@ -0,0 +1,69 @@
+// 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_BLUETOOTH_AGENT_SERVICE_PROVIDER_H_
+#define CHROMEOS_DBUS_FAKE_BLUETOOTH_AGENT_SERVICE_PROVIDER_H_
+
+#include "base/bind.h"
+#include "base/callback.h"
+#include "base/observer_list.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_client_implementation_type.h"
+#include "chromeos/dbus/experimental_bluetooth_agent_service_provider.h"
+#include "dbus/object_path.h"
+#include "dbus/property.h"
+
+namespace chromeos {
+
+class FakeBluetoothAgentManagerClient;
+
+// FakeBluetoothAgentServiceProvider simulates the behavior of a local
+// Bluetooth agent object and is used both in test cases in place of a
+// mock and on the Linux desktop.
+class CHROMEOS_EXPORT FakeBluetoothAgentServiceProvider
+ : public ExperimentalBluetoothAgentServiceProvider {
+ public:
+ FakeBluetoothAgentServiceProvider(const dbus::ObjectPath& object_path,
+ Delegate *delegate);
+ virtual ~FakeBluetoothAgentServiceProvider();
+
+ // Each of these calls the equivalent BluetoothAgentServiceProvider::Delegate
+ // method on the object passed on construction.
+ virtual void Release();
+ virtual void RequestPinCode(const dbus::ObjectPath& device_path,
+ const Delegate::PinCodeCallback& callback);
+ virtual void DisplayPinCode(const dbus::ObjectPath& device_path,
+ const std::string& pincode);
+ virtual void RequestPasskey(const dbus::ObjectPath& device_path,
+ const Delegate::PasskeyCallback& callback);
+ virtual void DisplayPasskey(const dbus::ObjectPath& device_path,
+ uint32 passkey, int16 entered);
+ virtual void RequestConfirmation(
+ const dbus::ObjectPath& device_path,
+ uint32 passkey,
+ const Delegate::ConfirmationCallback& callback);
+ virtual void RequestAuthorization(
+ const dbus::ObjectPath& device_path,
+ const Delegate::ConfirmationCallback& callback);
+ virtual void AuthorizeService(
+ const dbus::ObjectPath& device_path,
+ const std::string& uuid,
+ const Delegate::ConfirmationCallback& callback);
+ virtual void Cancel();
+
+ private:
+ friend class FakeBluetoothAgentManagerClient;
+
+ // D-Bus object path we are faking.
+ dbus::ObjectPath object_path_;
+
+ // All incoming method calls are passed on to the Delegate and a callback
+ // passed to generate the reply. |delegate_| is generally the object that
+ // owns this one, and must outlive it.
+ Delegate* delegate_;
+};
+
+} // namespace chromeos
+
+#endif /* CHROMEOS_DBUS_FAKE_BLUETOOTH_AGENT_SERVICE_PROVIDER_H_ */
« no previous file with comments | « chromeos/dbus/fake_bluetooth_agent_manager_client.cc ('k') | chromeos/dbus/fake_bluetooth_agent_service_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698