OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/observer_list.h" |
| 12 |
| 13 namespace dbus { |
| 14 class Bus; |
| 15 } // namespace dbus |
| 16 |
| 17 namespace chromeos { |
| 18 |
| 19 // BluetoothManagerClient is used to communicate with the bluetooth |
| 20 // daemon's Manager interface. |
| 21 class BluetoothManagerClient { |
| 22 public: |
| 23 // Interface for observing changes from the bluetooth manager. |
| 24 class Observer { |
| 25 public: |
| 26 virtual ~Observer() {} |
| 27 |
| 28 // Called when a local bluetooth adapter is removed. |
| 29 // |adapter| is the dbus object path of the adapter. |
| 30 virtual void AdapterRemoved(const std::string& adapter) = 0; |
| 31 |
| 32 // Called when the default local bluetooth adapter changes. |
| 33 // |adapter| is the dbus object path of the new default adapter. |
| 34 // Not called if all adapters are removed. |
| 35 virtual void DefaultAdapterChanged(const std::string& adapter) = 0; |
| 36 }; |
| 37 |
| 38 virtual ~BluetoothManagerClient(); |
| 39 |
| 40 // Adds and removes the observer. |
| 41 virtual void AddObserver(Observer* observer) = 0; |
| 42 virtual void RemoveObserver(Observer* observer) = 0; |
| 43 |
| 44 typedef base::Callback<void(std::string, bool)> DefaultAdapterCallback; |
| 45 |
| 46 // Retrieves the dbus object path for the default adapter. |
| 47 virtual void DefaultAdapter(const DefaultAdapterCallback& callback) = 0; |
| 48 |
| 49 // Creates the instance. |
| 50 static BluetoothManagerClient* Create(dbus::Bus* bus); |
| 51 |
| 52 protected: |
| 53 BluetoothManagerClient(); |
| 54 |
| 55 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(BluetoothManagerClient); |
| 57 }; |
| 58 |
| 59 } // namespace chromeos |
| 60 |
| 61 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ |
OLD | NEW |