Index: chromeos/dbus/cros_disks_client.h |
diff --git a/chromeos/dbus/cros_disks_client.h b/chromeos/dbus/cros_disks_client.h |
index 095566fca4082fbd9eeada69852a35ab5141ab8c..464d25885b7875770227e460f1685086fcfd1f35 100644 |
--- a/chromeos/dbus/cros_disks_client.h |
+++ b/chromeos/dbus/cros_disks_client.h |
@@ -19,6 +19,7 @@ class FilePath; |
} |
namespace dbus { |
+class MessageReader; |
class Response; |
} |
@@ -121,7 +122,7 @@ class CHROMEOS_EXPORT DiskInfo { |
// Does the disk have media content. |
bool has_media() const { return has_media_; } |
- // Is the disk on deveice we booted the machine from. |
+ // Is the disk on device we booted the machine from. |
bool on_boot_device() const { return on_boot_device_; } |
// Disk file path (e.g. /dev/sdb). |
@@ -184,6 +185,30 @@ class CHROMEOS_EXPORT DiskInfo { |
std::string uuid_; |
}; |
+// A class to represent information about a mount point sent from cros-disks. |
+class CHROMEOS_EXPORT MountEntry { |
stevenjb
2014/05/14 17:45:11
This could actually just be a struct since it does
kinaba
2014/05/15 02:14:59
Done.
|
+ public: |
+ MountEntry(); |
+ MountEntry(MountError error_code, |
+ const std::string& source_path, |
+ MountType mount_type, |
+ const std::string& mount_path); |
+ ~MountEntry(); |
+ |
+ static bool ReadFromDbus(dbus::MessageReader* reader, MountEntry* entry); |
+ |
+ MountError error_code() const { return error_code_; } |
+ const std::string& source_path() const { return source_path_; } |
+ MountType mount_type() const { return mount_type_; } |
+ const std::string& mount_path() const { return mount_path_; } |
+ |
+ private: |
+ MountError error_code_; |
+ std::string source_path_; |
+ MountType mount_type_; |
+ std::string mount_path_; |
+}; |
+ |
// A class to make the actual DBus calls for cros-disks service. |
// This class only makes calls, result/error handling should be done |
// by callbacks. |
@@ -194,21 +219,18 @@ class CHROMEOS_EXPORT CrosDisksClient : public DBusClient { |
typedef base::Callback<void(const std::vector<std::string>& device_paths)> |
EnumerateAutoMountableDevicesCallback; |
+ // A callback to handle the result of EnumerateMountEntries. |
+ // The argument is the enumerated mount entries. |
+ typedef base::Callback<void(const std::vector<MountEntry>& entries)> |
+ EnumerateMountEntriesCallback; |
+ |
// A callback to handle the result of GetDeviceProperties. |
// The argument is the information about the specified device. |
typedef base::Callback<void(const DiskInfo& disk_info)> |
GetDevicePropertiesCallback; |
// A callback to handle MountCompleted signal. |
- // The first argument is the error code. |
- // The second argument is the source path. |
- // The third argument is the mount type. |
- // The fourth argument is the mount path. |
- typedef base::Callback<void(MountError error_code, |
- const std::string& source_path, |
- MountType mount_type, |
- const std::string& mount_path)> |
- MountCompletedHandler; |
+ typedef base::Callback<void(const MountEntry& entry)> MountCompletedHandler; |
// A callback to handle FormatCompleted signal. |
// The first argument is the error code. |
@@ -254,6 +276,12 @@ class CHROMEOS_EXPORT CrosDisksClient : public DBusClient { |
const EnumerateAutoMountableDevicesCallback& callback, |
const base::Closure& error_callback) = 0; |
+ // Calls EnumerateMountEntries. |callback| is called after the |
+ // method call succeeds, otherwise, |error_callback| is called. |
+ virtual void EnumerateMountEntries( |
+ const EnumerateMountEntriesCallback& callback, |
+ const base::Closure& error_callback) = 0; |
+ |
// Calls Format method. |callback| is called after the method call succeeds, |
// otherwise, |error_callback| is called. |
virtual void Format(const std::string& device_path, |