Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chromeos / dbus / dbus_method_call_status.h
blob7c189e2055c64af2857722d6f11832a3630e707e
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.
5 #ifndef CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_
6 #define CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_
8 #include <string>
10 #include "base/callback.h"
11 #include "chromeos/chromeos_export.h"
13 namespace dbus {
15 class ObjectPath;
17 } // namespace dbus
19 namespace chromeos {
21 // An enum to describe whether or not a DBus method call succeeded.
22 enum DBusMethodCallStatus {
23 DBUS_METHOD_CALL_FAILURE,
24 DBUS_METHOD_CALL_SUCCESS,
27 // A callback to handle responses of methods without results.
28 typedef base::Callback<void(
29 DBusMethodCallStatus call_status)> VoidDBusMethodCallback;
31 // A callback to handle responses of methods returning a bool value.
32 typedef base::Callback<void(DBusMethodCallStatus call_status,
33 bool result)> BoolDBusMethodCallback;
35 // A callback to handle responses of methods returning a string value.
36 typedef base::Callback<void(
37 DBusMethodCallStatus call_status,
38 const std::string& result)> StringDBusMethodCallback;
40 // A callback to handle responses of methods returning a boolean value.
41 typedef base::Callback<void(
42 DBusMethodCallStatus call_status,
43 bool result)> BooleanDBusMethodCallback;
45 // A callback to handle responses of methods returning a ObjectPath value.
46 typedef base::Callback<void(
47 DBusMethodCallStatus call_status,
48 const dbus::ObjectPath& result)> ObjectPathDBusMethodCallback;
50 // A callback to handle responses of methods returning a ObjectPath value that
51 // doesn't get call status.
52 typedef base::Callback<void(const dbus::ObjectPath& result)> ObjectPathCallback;
54 // Returns an empty callback that does nothing.
55 CHROMEOS_EXPORT VoidDBusMethodCallback EmptyVoidDBusMethodCallback();
57 } // namespace chromeos
59 #endif // CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_