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

Unified Diff: chrome/browser/chromeos/dbus/bluetooth_manager_client.h

Issue 8375042: Chrome OS: Add bluetooth dbus clients for device discovery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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: chrome/browser/chromeos/dbus/bluetooth_manager_client.h
diff --git a/chrome/browser/chromeos/dbus/bluetooth_manager_client.h b/chrome/browser/chromeos/dbus/bluetooth_manager_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..5335a3e274c27730b85dec98eb352de15f89f192
--- /dev/null
+++ b/chrome/browser/chromeos/dbus/bluetooth_manager_client.h
@@ -0,0 +1,62 @@
+// Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_
+#define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_
+#pragma once
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/observer_list.h"
+
+namespace dbus {
+class Bus;
+} // namespace dbus
+
+namespace chromeos {
+
+// BluetoothManagerClient is used to communicate with the bluetooth
+// daemon's Manager interface.
+class BluetoothManagerClient {
+ public:
+ // Interface for observing changes from the bluetooth manager.
+ class Observer {
+ public:
+ virtual ~Observer() {}
+
+ // Called when a local bluetooth adapter is removed.
+ // |adapter| is the dbus object path of the adapter.
+ virtual void AdapterRemoved(const std::string& adapter) = 0;
+
+ // Called when the default local bluetooth adapter changes.
+ // |adapter| is the dbus object path of the new default adapter.
+ // Not called if all adapters are removed.
+ virtual void DefaultAdapterChanged(const std::string& adapter) = 0;
+ };
+
+ virtual ~BluetoothManagerClient();
+
+ // Adds and removes the observer.
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ typedef base::Callback<void(std::string, bool)> DefaultAdapterCallback;
satorux1 2011/10/25 02:17:10 Please document parameters.
Vince Laviano 2011/10/25 19:18:03 Done.
+
+ // Retrieves the dbus object path for the default adapter.
satorux1 2011/10/25 02:17:10 What's is the default adapter? I'd like to see som
Vince Laviano 2011/10/25 19:18:03 Done.
+ virtual void DefaultAdapter(const DefaultAdapterCallback& callback) = 0;
+
+ // Creates the instance.
+ static BluetoothManagerClient* Create(dbus::Bus* bus);
+
+ protected:
+ BluetoothManagerClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BluetoothManagerClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698