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

Unified Diff: chrome/browser/chromeos/dbus/bluetooth_adapter_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_adapter_client.h
diff --git a/chrome/browser/chromeos/dbus/bluetooth_adapter_client.h b/chrome/browser/chromeos/dbus/bluetooth_adapter_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..4bb6e699f6bdc6f693527c6ad0548ca336385c7e
--- /dev/null
+++ b/chrome/browser/chromeos/dbus/bluetooth_adapter_client.h
@@ -0,0 +1,69 @@
+// 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_ADAPTER_CLIENT_H_
+#define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_
+#pragma once
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/observer_list.h"
+#include "base/values.h"
+
+namespace dbus {
+class Bus;
+} // namespace dbus
+
+namespace chromeos {
+
+// BluetoothAdapterClient is used to communicate with a bluetooth Adapter
+// interface.
+class BluetoothAdapterClient {
+ public:
+ // Interface for observing changes from a local bluetooth adapter.
+ class Observer {
+ public:
+ virtual ~Observer() {}
+
+ // Called when the adapter's Discovering property changes.
+ virtual void DiscoveringPropertyChanged(const std::string& path,
+ bool discovering) = 0;
satorux1 2011/10/25 02:17:10 Instead of = 0, you might want to go with {}, so t
Vince Laviano 2011/10/25 19:18:03 Done.
+
+ // Called when a new remote device has been discovered.
+ // |device_properties| should be copied if needed.
+ virtual void DeviceFound(const std::string& path,
+ const std::string& address,
+ const DictionaryValue& device_properties) = 0;
+
+ // Called when a previously discovered device is no longer visible.
+ virtual void DeviceDisappeared(const std::string& path,
+ const std::string& address) = 0;
+ };
+
+ virtual ~BluetoothAdapterClient();
+
+ // Adds and removes observers for events on the adapter with path |path|.
+ virtual void AddObserver(Observer* observer, const std::string& path) = 0;
+ virtual void RemoveObserver(Observer* observer, const std::string& path) = 0;
+
+ // Starts a device discovery on the adapter with path |path|.
+ virtual void StartDiscovery(const std::string& path) = 0;
+
+ // Cancels any previous device discovery on the adapter with path |path|.
+ virtual void StopDiscovery(const std::string& path) = 0;
+
+ // Creates the instance.
+ static BluetoothAdapterClient* Create(dbus::Bus* bus);
+
+ protected:
+ BluetoothAdapterClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698