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_ADAPTER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_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 #include "base/values.h" | 13 #include "base/values.h" |
14 | 14 |
15 namespace dbus { | 15 namespace dbus { |
16 class Bus; | 16 class Bus; |
17 } // namespace dbus | 17 } // namespace dbus |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 | 20 |
21 // BluetoothAdapterClient is used to communicate with a bluetooth Adapter | 21 // BluetoothAdapterClient is used to communicate with a bluetooth Adapter |
22 // interface. | 22 // interface. |
23 class BluetoothAdapterClient { | 23 class BluetoothAdapterClient { |
24 public: | 24 public: |
25 // Interface for observing changes from a local bluetooth adapter. | 25 // Interface for observing changes from a local bluetooth adapter. |
26 class Observer { | 26 class Observer { |
27 public: | 27 public: |
28 virtual ~Observer() {} | 28 virtual ~Observer() {} |
29 | 29 |
30 // Called when a new known device has been created. | |
31 virtual void DeviceCreated(const std::string& adapter_path, | |
32 const std::string& object_path) {} | |
mukesh agrawal
2012/02/01 00:48:42
i'm somewhat surprised that these have default imp
satorux1
2012/02/01 17:45:18
I think it's not so uncommon for observers to have
| |
33 | |
34 // Called when a previously known device is removed. | |
35 virtual void DeviceRemoved(const std::string& adapter_path, | |
36 const std::string& object_path) {} | |
37 | |
30 // Called when the adapter's Discovering property changes. | 38 // Called when the adapter's Discovering property changes. |
31 virtual void DiscoveringPropertyChanged(const std::string& object_path, | 39 virtual void DiscoveringPropertyChanged(const std::string& object_path, |
32 bool discovering) {} | 40 bool discovering) {} |
33 | 41 |
34 // Called when a new remote device has been discovered. | 42 // Called when a new remote device has been discovered. |
35 // |device_properties| should be copied if needed. | 43 // |device_properties| should be copied if needed. |
36 virtual void DeviceFound(const std::string& object_path, | 44 virtual void DeviceFound(const std::string& object_path, |
37 const std::string& address, | 45 const std::string& address, |
38 const DictionaryValue& device_properties) {} | 46 const DictionaryValue& device_properties) {} |
39 | 47 |
(...skipping 24 matching lines...) Expand all Loading... | |
64 protected: | 72 protected: |
65 BluetoothAdapterClient(); | 73 BluetoothAdapterClient(); |
66 | 74 |
67 private: | 75 private: |
68 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterClient); | 76 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterClient); |
69 }; | 77 }; |
70 | 78 |
71 } // namespace chromeos | 79 } // namespace chromeos |
72 | 80 |
73 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_ | 81 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_ |
OLD | NEW |