| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 | 13 |
| 14 namespace dbus { | 14 namespace dbus { |
| 15 class Bus; | 15 class Bus; |
| 16 } // namespace dbus | 16 } // namespace dbus |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 // BluetoothManagerClient is used to communicate with the bluetooth | 20 // BluetoothManagerClient is used to communicate with the bluetooth |
| 21 // daemon's Manager interface. | 21 // daemon's Manager interface. |
| 22 class BluetoothManagerClient { | 22 class BluetoothManagerClient { |
| 23 public: | 23 public: |
| 24 // Interface for observing changes from the bluetooth manager. | 24 // Interface for observing changes from the bluetooth manager. |
| 25 class Observer { | 25 class Observer { |
| 26 public: | 26 public: |
| 27 virtual ~Observer() {} | 27 virtual ~Observer() {} |
| 28 | 28 |
| 29 // Called when a local bluetooth adapter is added. |
| 30 // |object_path| is the dbus object path of the adapter. |
| 31 virtual void AdapterAdded(const std::string& object_path) {} |
| 32 |
| 29 // Called when a local bluetooth adapter is removed. | 33 // Called when a local bluetooth adapter is removed. |
| 30 // |adapter| is the dbus object path of the adapter. | 34 // |object_path| is the dbus object path of the adapter. |
| 31 virtual void AdapterRemoved(const std::string& adapter) {} | 35 virtual void AdapterRemoved(const std::string& object_path) {} |
| 32 | 36 |
| 33 // Called when the default local bluetooth adapter changes. | 37 // Called when the default local bluetooth adapter changes. |
| 34 // |adapter| is the dbus object path of the new default adapter. | 38 // |adapter| is the dbus object path of the new default adapter. |
| 35 // Not called if all adapters are removed. | 39 // Not called if all adapters are removed. |
| 36 virtual void DefaultAdapterChanged(const std::string& adapter) {} | 40 virtual void DefaultAdapterChanged(const std::string& adapter) {} |
| 37 }; | 41 }; |
| 38 | 42 |
| 39 virtual ~BluetoothManagerClient(); | 43 virtual ~BluetoothManagerClient(); |
| 40 | 44 |
| 41 // Adds and removes the observer. | 45 // Adds and removes the observer. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 59 protected: | 63 protected: |
| 60 BluetoothManagerClient(); | 64 BluetoothManagerClient(); |
| 61 | 65 |
| 62 private: | 66 private: |
| 63 DISALLOW_COPY_AND_ASSIGN(BluetoothManagerClient); | 67 DISALLOW_COPY_AND_ASSIGN(BluetoothManagerClient); |
| 64 }; | 68 }; |
| 65 | 69 |
| 66 } // namespace chromeos | 70 } // namespace chromeos |
| 67 | 71 |
| 68 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ | 72 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_ |
| OLD | NEW |