| 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..903c3ec51f2fa6ec2d2c82b0acfba12b2f62c698
|
| --- /dev/null
|
| +++ b/chrome/browser/chromeos/dbus/bluetooth_adapter_client.h
|
| @@ -0,0 +1,68 @@
|
| +// 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_
|
| +
|
| +#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;
|
| +
|
| + // 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_
|
|
|