Chromium Code Reviews| Index: chromeos/dbus/media_transfer_protocol_daemon_client.h |
| =================================================================== |
| --- chromeos/dbus/media_transfer_protocol_daemon_client.h (revision 154535) |
| +++ chromeos/dbus/media_transfer_protocol_daemon_client.h (working copy) |
| @@ -17,12 +17,14 @@ |
| #include "base/time.h" |
| #include "chromeos/chromeos_export.h" |
| #include "chromeos/dbus/dbus_client_implementation_type.h" |
| +#include "chromeos/dbus/mtp_file_entry.pb.h" |
| namespace dbus { |
| class Bus; |
| -class Response; |
| } |
| +class MtpStorageInfo; |
| + |
| namespace chromeos { |
| // Mode to open a storage in. |
| @@ -30,32 +32,12 @@ |
| OPEN_STORAGE_MODE_READ_ONLY, |
| }; |
| -// Values match libmtp values unless noted below. |
| -// TODO(thestig) See if we can do better than this. |
| -enum FileType { |
|
Lei Zhang
2012/09/01 00:46:34
I hate to have this enum to match the one in the p
satorux1
2012/09/01 01:03:50
that sounds ok to me. mtp_file_entry_proto target
|
| - FILE_TYPE_FOLDER = 0, |
| - FILE_TYPE_JPEG = 14, |
| - FILE_TYPE_JFIF = 15, |
| - FILE_TYPE_TIFF = 16, |
| - FILE_TYPE_BMP = 17, |
| - FILE_TYPE_GIF = 18, |
| - FILE_TYPE_PICT = 19, |
| - FILE_TYPE_PNG = 20, |
| - FILE_TYPE_WINDOWSIMAGEFORMAT = 25, |
| - FILE_TYPE_JP2 = 40, |
| - FILE_TYPE_JPX = 41, |
| - // Truly unknown file type. |
| - FILE_TYPE_UNKNOWN = 44, |
| - // There's more file types to map to, but right now they are not interesting. |
| - // Just assign a dummy value for now. |
| - FILE_TYPE_OTHER = 9999 |
| -}; |
| - |
| // A class to represent information about a storage sent from mtpd. |
| class CHROMEOS_EXPORT StorageInfo { |
| public: |
| StorageInfo(); |
| - StorageInfo(const std::string& storage_name, dbus::Response* response); |
| + StorageInfo(const std::string& storage_name, |
| + const MtpStorageInfo& storage_info); |
| ~StorageInfo(); |
| // Storage name. (e.g. usb:1,5:65537) |
| @@ -103,8 +85,6 @@ |
| const std::string& volume_identifier() const { return volume_identifier_; } |
| private: |
| - void InitializeFromResponse(dbus::Response* response); |
| - |
| // Device info. (A device can have multiple storages) |
| std::string vendor_; |
| uint16 vendor_id_; |
| @@ -128,7 +108,7 @@ |
| class CHROMEOS_EXPORT FileEntry { |
| public: |
| FileEntry(); |
| - explicit FileEntry(dbus::Response* response); |
| + explicit FileEntry(const MtpFileEntry& entry); |
| ~FileEntry(); |
| // ID for the file. |
| @@ -144,21 +124,19 @@ |
| uint64 file_size() const { return file_size_; } |
| // Modification time of the file. |
| - base::Time modification_date() const { return modification_date_; } |
| + base::Time modification_time() const { return modification_time_; } |
| // File type. |
| - FileType file_type() const { return file_type_; } |
| + MtpFileEntry_FileType file_type() const { return file_type_; } |
| private: |
| - void InitializeFromResponse(dbus::Response* response); |
| - |
| // Storage info. |
| uint32 item_id_; |
| uint32 parent_id_; |
| std::string file_name_; |
| uint64 file_size_; |
| - base::Time modification_date_; |
| - FileType file_type_; |
| + base::Time modification_time_; |
| + MtpFileEntry_FileType file_type_; |
| }; |
| // A class to make the actual DBus calls for mtpd service. |