Chromium Code Reviews| 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..e882a8d35290d86f03fb883219dbb8783b57c767 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.h |
| @@ -0,0 +1,65 @@ |
| +// 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_ |
| +#pragma once |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| + |
| +namespace chromeos { |
| + |
| +class BluetoothDevice; |
| + |
| +class BluetoothAdapter { |
|
satorux1
2011/10/26 19:26:55
Please add a class comment.
Vince Laviano
2011/10/26 21:41:55
Done.
|
| + 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) {} |
| + |
| + // The discovery process has ended on adapter |adapter_id|. |
| + virtual void DiscoveryEnded(const std::string& adapter_id) {} |
| + |
| + // 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) {} |
| + |
| + 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_ |