Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: device/bluetooth/dbus/bluetooth_profile_service_provider.h

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CHROMEOS_DBUS_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_ 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_
6 #define CHROMEOS_DBUS_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_ 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "chromeos/chromeos_export.h"
14 #include "dbus/bus.h" 13 #include "dbus/bus.h"
15 #include "dbus/file_descriptor.h" 14 #include "dbus/file_descriptor.h"
16 #include "dbus/object_path.h" 15 #include "dbus/object_path.h"
16 #include "device/bluetooth/bluetooth_export.h"
17 17
18 namespace chromeos { 18 namespace bluez {
19 19
20 // BluetoothProfileServiceProvider is used to provide a D-Bus object that the 20 // BluetoothProfileServiceProvider is used to provide a D-Bus object that the
21 // Bluetooth daemon can communicate with to connect application profiles. 21 // Bluetooth daemon can communicate with to connect application profiles.
22 // 22 //
23 // Instantiate with a chosen D-Bus object path and delegate object, and pass 23 // Instantiate with a chosen D-Bus object path and delegate object, and pass
24 // the D-Bus object path as the |agent_path| argument to the 24 // the D-Bus object path as the |agent_path| argument to the
25 // chromeos::BluetoothProfileManagerClient::RegisterProfile() method. 25 // chromeos::BluetoothProfileManagerClient::RegisterProfile() method.
26 // 26 //
27 // When an incoming profile connection occurs, or after initiating a connection 27 // When an incoming profile connection occurs, or after initiating a connection
28 // using the chromeos::BluetoothDeviceClient::ConnectProfile() method, the 28 // using the chromeos::BluetoothDeviceClient::ConnectProfile() method, the
29 // Bluetooth daemon will make calls to this profile object and they will be 29 // Bluetooth daemon will make calls to this profile object and they will be
30 // passed on to your Delegate object for handling. Responses should be returned 30 // passed on to your Delegate object for handling. Responses should be returned
31 // using the callbacks supplied to those methods. 31 // using the callbacks supplied to those methods.
32 class CHROMEOS_EXPORT BluetoothProfileServiceProvider { 32 class DEVICE_BLUETOOTH_EXPORT BluetoothProfileServiceProvider {
33 public: 33 public:
34 // Interface for reacting to profile requests. 34 // Interface for reacting to profile requests.
35 class Delegate { 35 class Delegate {
36 public: 36 public:
37 virtual ~Delegate() {} 37 virtual ~Delegate() {}
38 38
39 // Possible status values that may be returned to callbacks on a new 39 // Possible status values that may be returned to callbacks on a new
40 // connection or a requested disconnection. Success indicates acceptance, 40 // connection or a requested disconnection. Success indicates acceptance,
41 // reject indicates the user rejected or denied the request; cancelled 41 // reject indicates the user rejected or denied the request; cancelled
42 // means the user cancelled the request without confirming either way. 42 // means the user cancelled the request without confirming either way.
43 enum Status { 43 enum Status { SUCCESS, REJECTED, CANCELLED };
44 SUCCESS,
45 REJECTED,
46 CANCELLED
47 };
48 44
49 // Connection-specific options. 45 // Connection-specific options.
50 struct CHROMEOS_EXPORT Options { 46 struct DEVICE_BLUETOOTH_EXPORT Options {
51 Options() {} 47 Options() {}
52 ~Options() {} 48 ~Options() {}
53 49
54 // Profile version. 50 // Profile version.
55 uint16 version; 51 uint16 version;
56 52
57 // Profile features. 53 // Profile features.
58 uint16 features; 54 uint16 features;
59 }; 55 };
60 56
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 const dbus::ObjectPath& object_path, 108 const dbus::ObjectPath& object_path,
113 Delegate* delegate); 109 Delegate* delegate);
114 110
115 protected: 111 protected:
116 BluetoothProfileServiceProvider(); 112 BluetoothProfileServiceProvider();
117 113
118 private: 114 private:
119 DISALLOW_COPY_AND_ASSIGN(BluetoothProfileServiceProvider); 115 DISALLOW_COPY_AND_ASSIGN(BluetoothProfileServiceProvider);
120 }; 116 };
121 117
122 } // namespace chromeos 118 } // namespace bluez
123 119
124 #endif // CHROMEOS_DBUS_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_ 120 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/bluetooth_profile_manager_client.cc ('k') | device/bluetooth/dbus/bluetooth_profile_service_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698