OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 #include <vector> | |
11 | |
12 #include "base/callback.h" | |
13 #include "chrome/browser/chromeos/dbus/dbus_client_implementation_type.h" | |
14 #include "dbus/object_path.h" | |
15 | |
16 namespace dbus { | |
17 class Bus; | |
18 } // namespace dbus | |
19 | |
20 namespace chromeos { | |
21 | |
22 // IntrospectableClient is used to retrieve the D-Bus introspection data | |
23 // from a remote object. | |
24 class IntrospectableClient { | |
25 public: | |
26 virtual ~IntrospectableClient(); | |
27 | |
28 // The IntrospectCallback is used for the Introspect() method. It receives | |
29 // four arguments, the first two are the |service_name| and |object_path| | |
30 // of the remote object being introspected, the third is the |xml_data| of | |
31 // the object as described in | |
32 // http://dbus.freedesktop.org/doc/dbus-specification.html, the fourth | |
33 // |success| indicates whether the request succeeded. | |
34 typedef base::Callback<void(const std::string&, const dbus::ObjectPath&, | |
35 const std::string&, bool)> IntrospectCallback; | |
36 | |
37 // Retrieves introspection data from the remote object on service name | |
38 // |service_name| with object path |object_path|, calling |callback| with | |
39 // the XML-formatted data received. | |
40 virtual void Introspect(const std::string& service_name, | |
41 const dbus::ObjectPath& object_path, | |
42 const IntrospectCallback& callback) = 0; | |
43 | |
44 // Creates the instance | |
45 static IntrospectableClient* Create(DBusClientImplementationType type, | |
46 dbus::Bus* bus); | |
47 | |
48 protected: | |
49 IntrospectableClient(); | |
50 | |
51 private: | |
52 DISALLOW_COPY_AND_ASSIGN(IntrospectableClient); | |
53 }; | |
54 | |
55 } // namespace chromeos | |
56 | |
57 #endif // CHROME_BROWSER_CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ | |
OLD | NEW |