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