Index: chrome/browser/chromeos/extensions/file_manager/event_router.cc |
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc |
index 14efa96a354914290cd4b8156c5b1520c2b7a7d6..9e7d09a55b0295c36442b00a929390a756d2630c 100644 |
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc |
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc |
@@ -180,6 +180,8 @@ CopyProgressTypeToCopyProgressStatusType( |
return file_manager_private::COPY_PROGRESS_STATUS_TYPE_END_COPY_ENTRY; |
case storage::FileSystemOperation::PROGRESS: |
return file_manager_private::COPY_PROGRESS_STATUS_TYPE_PROGRESS; |
+ case storage::FileSystemOperation::ERROR_COPY_ENTRY: |
+ return file_manager_private::COPY_PROGRESS_STATUS_TYPE_ERROR; |
} |
NOTREACHED(); |
return file_manager_private::COPY_PROGRESS_STATUS_TYPE_NONE; |
@@ -544,11 +546,20 @@ void EventRouter::OnCopyProgress( |
file_manager_private::CopyProgressStatus status; |
status.type = CopyProgressTypeToCopyProgressStatusType(type); |
status.source_url.reset(new std::string(source_url.spec())); |
- if (type == storage::FileSystemOperation::END_COPY_ENTRY) |
+ if (type == storage::FileSystemOperation::END_COPY_ENTRY || |
+ type == storage::FileSystemOperation::ERROR_COPY_ENTRY) |
status.destination_url.reset(new std::string(destination_url.spec())); |
+ if (type == storage::FileSystemOperation::ERROR_COPY_ENTRY) |
+ status.error.reset( |
+ new std::string(FileErrorToErrorName(base::File::FILE_ERROR_FAILED))); |
if (type == storage::FileSystemOperation::PROGRESS) |
status.size.reset(new double(size)); |
+ // Discard error progress since current JS code cannot handle this properly. |
+ // TODO(yawano): Remove this after JS side is implemented correctly. |
+ if (type == storage::FileSystemOperation::ERROR_COPY_ENTRY) |
+ return; |
+ |
// Should not skip events other than TYPE_PROGRESS. |
const bool always = |
status.type != file_manager_private::COPY_PROGRESS_STATUS_TYPE_PROGRESS; |