Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2344)

Unified Diff: chrome/browser/chromeos/extensions/file_manager/event_router.cc

Issue 1194783002: Add fileManagerPrivate.onCopyError event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove const and rename enum. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698