| 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_
|
|
|