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

Unified Diff: chrome/browser/chromeos/bluetooth/bluetooth_adapter.h

Issue 8233042: Chrome OS: Attach bluetooth UI to device discovery API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: replace empty device names with mac address 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/bluetooth/bluetooth_adapter.h
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.h b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.h
new file mode 100644
index 0000000000000000000000000000000000000000..84bfaddcca746e6079a2f4e33fe8d829c6cde8d3
--- /dev/null
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.h
@@ -0,0 +1,64 @@
+// 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_BLUETOOTH_BLUETOOTH_ADAPTER_H_
+#define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+
+namespace chromeos {
+
+class BluetoothDevice;
+
+class BluetoothAdapter {
+ public:
+ // Interface for observing changes from bluetooth adapters.
+ class Observer {
+ public:
+ // The discovery process has started on adapter |adapter_id|.
+ virtual void DiscoveryStarted(const std::string& adapter_id) = 0;
+
+ // The discovery process has ended on adapter |adapter_id|.
+ virtual void DiscoveryEnded(const std::string& adapter_id) = 0;
+
+ // A device has been discovered on adapter |adapter_id|.
+ // The observer should not cache the |device| pointer.
+ virtual void DeviceFound(const std::string& adapter_id,
+ BluetoothDevice* device) = 0;
+
+ virtual ~Observer() {}
+ };
+
+ virtual ~BluetoothAdapter();
+
+ // Adds and removes the observer.
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ // Returns the unique identifier for this adapter.
+ virtual const std::string& id() const = 0;
+
+ // Starts a device discovery on this adapter.
+ // Caller should call AddObserver() first since results will be received via
+ // the Observer interface.
+ virtual void StartDiscovery() = 0;
+
+ // Cancels any previous device discovery on this adapter.
+ virtual void StopDiscovery() = 0;
+
+ // Creates an adapter with id |id|.
+ static BluetoothAdapter* Create(const std::string& id);
+
+ protected:
+ BluetoothAdapter();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BluetoothAdapter);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_ADAPTER_H_

Powered by Google App Engine
This is Rietveld 408576698