OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PERMISSION_BROKER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ |
6 #define CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // http://git.chromium.org/gitweb/?p=chromiumos/platform/permission_broker.git | 24 // http://git.chromium.org/gitweb/?p=chromiumos/platform/permission_broker.git |
25 class CHROMEOS_EXPORT PermissionBrokerClient : public DBusClient { | 25 class CHROMEOS_EXPORT PermissionBrokerClient : public DBusClient { |
26 public: | 26 public: |
27 // The ResultCallback is used for both the RequestPathAccess and | 27 // The ResultCallback is used for both the RequestPathAccess and |
28 // RequestUsbAcess methods. Its boolean parameter represents the result of the | 28 // RequestUsbAcess methods. Its boolean parameter represents the result of the |
29 // operation that it was submitted alongside. | 29 // operation that it was submitted alongside. |
30 typedef base::Callback<void(bool)> ResultCallback; | 30 typedef base::Callback<void(bool)> ResultCallback; |
31 | 31 |
32 virtual ~PermissionBrokerClient(); | 32 virtual ~PermissionBrokerClient(); |
33 | 33 |
34 static PermissionBrokerClient* Create(DBusClientImplementationType type); | 34 static PermissionBrokerClient* Create(); |
35 | 35 |
36 // RequestPathAccess requests access to a single device node identified by | 36 // RequestPathAccess requests access to a single device node identified by |
37 // |path|. If |interface_id| value is passed (different than | 37 // |path|. If |interface_id| value is passed (different than |
38 // UsbDevicePermissionData::ANY_INTERFACE), the request will check if a | 38 // UsbDevicePermissionData::ANY_INTERFACE), the request will check if a |
39 // specific interface is claimed while requesting access. | 39 // specific interface is claimed while requesting access. |
40 // This allows devices with multiple interfaces to be accessed even if | 40 // This allows devices with multiple interfaces to be accessed even if |
41 // some of them are already claimed by kernel. | 41 // some of them are already claimed by kernel. |
42 virtual void RequestPathAccess(const std::string& path, | 42 virtual void RequestPathAccess(const std::string& path, |
43 int interface_id, | 43 int interface_id, |
44 const ResultCallback& callback) = 0; | 44 const ResultCallback& callback) = 0; |
(...skipping 13 matching lines...) Expand all Loading... |
58 protected: | 58 protected: |
59 PermissionBrokerClient(); | 59 PermissionBrokerClient(); |
60 | 60 |
61 private: | 61 private: |
62 DISALLOW_COPY_AND_ASSIGN(PermissionBrokerClient); | 62 DISALLOW_COPY_AND_ASSIGN(PermissionBrokerClient); |
63 }; | 63 }; |
64 | 64 |
65 } // namespace chromeos | 65 } // namespace chromeos |
66 | 66 |
67 #endif // CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ | 67 #endif // CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ |
OLD | NEW |