| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/storage_monitor/test_media_transfer_protocol_manager_linux.
h" | 5 #include "components/storage_monitor/test_media_transfer_protocol_manager_chrome
os.h" |
| 6 | 6 |
| 7 #include "device/media_transfer_protocol/mtp_file_entry.pb.h" | 7 #include "device/media_transfer_protocol/mtp_file_entry.pb.h" |
| 8 #include "device/media_transfer_protocol/mtp_storage_info.pb.h" | 8 #include "device/media_transfer_protocol/mtp_storage_info.pb.h" |
| 9 | 9 |
| 10 namespace storage_monitor { | 10 namespace storage_monitor { |
| 11 | 11 |
| 12 TestMediaTransferProtocolManagerLinux:: | 12 TestMediaTransferProtocolManagerChromeOS:: |
| 13 TestMediaTransferProtocolManagerLinux() {} | 13 TestMediaTransferProtocolManagerChromeOS() {} |
| 14 | 14 |
| 15 TestMediaTransferProtocolManagerLinux:: | 15 TestMediaTransferProtocolManagerChromeOS:: |
| 16 ~TestMediaTransferProtocolManagerLinux() {} | 16 ~TestMediaTransferProtocolManagerChromeOS() {} |
| 17 | 17 |
| 18 void TestMediaTransferProtocolManagerLinux::AddObserver(Observer* observer) {} | 18 void TestMediaTransferProtocolManagerChromeOS::AddObserver(Observer* observer) { |
| 19 } |
| 19 | 20 |
| 20 void TestMediaTransferProtocolManagerLinux::RemoveObserver( | 21 void TestMediaTransferProtocolManagerChromeOS::RemoveObserver( |
| 21 Observer* observer) {} | 22 Observer* observer) {} |
| 22 | 23 |
| 23 const std::vector<std::string> | 24 const std::vector<std::string> |
| 24 TestMediaTransferProtocolManagerLinux::GetStorages() const { | 25 TestMediaTransferProtocolManagerChromeOS::GetStorages() const { |
| 25 return std::vector<std::string>(); | 26 return std::vector<std::string>(); |
| 26 } | 27 } |
| 27 const MtpStorageInfo* TestMediaTransferProtocolManagerLinux::GetStorageInfo( | 28 const MtpStorageInfo* TestMediaTransferProtocolManagerChromeOS::GetStorageInfo( |
| 28 const std::string& storage_name) const { | 29 const std::string& storage_name) const { |
| 29 return NULL; | 30 return NULL; |
| 30 } | 31 } |
| 31 | 32 |
| 32 void TestMediaTransferProtocolManagerLinux::GetStorageInfoFromDevice( | 33 void TestMediaTransferProtocolManagerChromeOS::GetStorageInfoFromDevice( |
| 33 const std::string& storage_name, | 34 const std::string& storage_name, |
| 34 const GetStorageInfoFromDeviceCallback& callback) { | 35 const GetStorageInfoFromDeviceCallback& callback) { |
| 35 MtpStorageInfo mtp_storage_info; | 36 MtpStorageInfo mtp_storage_info; |
| 36 callback.Run(mtp_storage_info, true /* error */); | 37 callback.Run(mtp_storage_info, true /* error */); |
| 37 } | 38 } |
| 38 | 39 |
| 39 void TestMediaTransferProtocolManagerLinux::OpenStorage( | 40 void TestMediaTransferProtocolManagerChromeOS::OpenStorage( |
| 40 const std::string& storage_name, | 41 const std::string& storage_name, |
| 41 const std::string& mode, | 42 const std::string& mode, |
| 42 const OpenStorageCallback& callback) { | 43 const OpenStorageCallback& callback) { |
| 43 callback.Run("", true); | 44 callback.Run("", true); |
| 44 } | 45 } |
| 45 | 46 |
| 46 void TestMediaTransferProtocolManagerLinux::CloseStorage( | 47 void TestMediaTransferProtocolManagerChromeOS::CloseStorage( |
| 47 const std::string& storage_handle, | 48 const std::string& storage_handle, |
| 48 const CloseStorageCallback& callback) { | 49 const CloseStorageCallback& callback) { |
| 49 callback.Run(true); | 50 callback.Run(true); |
| 50 } | 51 } |
| 51 | 52 |
| 52 void TestMediaTransferProtocolManagerLinux::CreateDirectory( | 53 void TestMediaTransferProtocolManagerChromeOS::CreateDirectory( |
| 53 const std::string& storage_handle, | 54 const std::string& storage_handle, |
| 54 const uint32_t parent_id, | 55 const uint32_t parent_id, |
| 55 const std::string& directory_name, | 56 const std::string& directory_name, |
| 56 const CreateDirectoryCallback& callback) { | 57 const CreateDirectoryCallback& callback) { |
| 57 callback.Run(true /* error */); | 58 callback.Run(true /* error */); |
| 58 } | 59 } |
| 59 | 60 |
| 60 void TestMediaTransferProtocolManagerLinux::ReadDirectory( | 61 void TestMediaTransferProtocolManagerChromeOS::ReadDirectory( |
| 61 const std::string& storage_handle, | 62 const std::string& storage_handle, |
| 62 const uint32_t file_id, | 63 const uint32_t file_id, |
| 63 const size_t max_size, | 64 const size_t max_size, |
| 64 const ReadDirectoryCallback& callback) { | 65 const ReadDirectoryCallback& callback) { |
| 65 callback.Run(std::vector<MtpFileEntry>(), | 66 callback.Run(std::vector<MtpFileEntry>(), false /* no more entries*/, |
| 66 false /* no more entries*/, | |
| 67 true /* error */); | 67 true /* error */); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void TestMediaTransferProtocolManagerLinux::ReadFileChunk( | 70 void TestMediaTransferProtocolManagerChromeOS::ReadFileChunk( |
| 71 const std::string& storage_handle, | 71 const std::string& storage_handle, |
| 72 uint32_t file_id, | 72 uint32_t file_id, |
| 73 uint32_t offset, | 73 uint32_t offset, |
| 74 uint32_t count, | 74 uint32_t count, |
| 75 const ReadFileCallback& callback) { | 75 const ReadFileCallback& callback) { |
| 76 callback.Run(std::string(), true); | 76 callback.Run(std::string(), true); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void TestMediaTransferProtocolManagerLinux::GetFileInfo( | 79 void TestMediaTransferProtocolManagerChromeOS::GetFileInfo( |
| 80 const std::string& storage_handle, | 80 const std::string& storage_handle, |
| 81 uint32_t file_id, | 81 uint32_t file_id, |
| 82 const GetFileInfoCallback& callback) { | 82 const GetFileInfoCallback& callback) { |
| 83 callback.Run(MtpFileEntry(), true); | 83 callback.Run(MtpFileEntry(), true); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void TestMediaTransferProtocolManagerLinux::RenameObject( | 86 void TestMediaTransferProtocolManagerChromeOS::RenameObject( |
| 87 const std::string& storage_handle, | 87 const std::string& storage_handle, |
| 88 const uint32_t object_id, | 88 const uint32_t object_id, |
| 89 const std::string& new_name, | 89 const std::string& new_name, |
| 90 const RenameObjectCallback& callback) { | 90 const RenameObjectCallback& callback) { |
| 91 callback.Run(true /* error */); | 91 callback.Run(true /* error */); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void TestMediaTransferProtocolManagerLinux::CopyFileFromLocal( | 94 void TestMediaTransferProtocolManagerChromeOS::CopyFileFromLocal( |
| 95 const std::string& storage_handle, | 95 const std::string& storage_handle, |
| 96 const int source_file_descriptor, | 96 const int source_file_descriptor, |
| 97 const uint32_t parent_id, | 97 const uint32_t parent_id, |
| 98 const std::string& file_name, | 98 const std::string& file_name, |
| 99 const CopyFileFromLocalCallback& callback) { | 99 const CopyFileFromLocalCallback& callback) { |
| 100 callback.Run(true /* error */); | 100 callback.Run(true /* error */); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void TestMediaTransferProtocolManagerLinux::DeleteObject( | 103 void TestMediaTransferProtocolManagerChromeOS::DeleteObject( |
| 104 const std::string& storage_handle, | 104 const std::string& storage_handle, |
| 105 const uint32_t object_id, | 105 const uint32_t object_id, |
| 106 const DeleteObjectCallback& callback) { | 106 const DeleteObjectCallback& callback) { |
| 107 callback.Run(true /* error */); | 107 callback.Run(true /* error */); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace storage_monitor | 110 } // namespace storage_monitor |
| OLD | NEW |