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

Unified Diff: storage/browser/fileapi/copy_or_move_operation_delegate.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
Index: storage/browser/fileapi/copy_or_move_operation_delegate.cc
diff --git a/storage/browser/fileapi/copy_or_move_operation_delegate.cc b/storage/browser/fileapi/copy_or_move_operation_delegate.cc
index 1cb92f5a838d371443aa749598db26de68449003..cf4692bfa5725ee731eddf9e15dda096c8eab9f6 100644
--- a/storage/browser/fileapi/copy_or_move_operation_delegate.cc
+++ b/storage/browser/fileapi/copy_or_move_operation_delegate.cc
@@ -730,6 +730,7 @@ CopyOrMoveOperationDelegate::CopyOrMoveOperationDelegate(
const FileSystemURL& dest_root,
OperationType operation_type,
CopyOrMoveOption option,
+ ErrorBehavior error_behavior,
const CopyProgressCallback& progress_callback,
const StatusCallback& callback)
: RecursiveOperationDelegate(file_system_context),
@@ -737,6 +738,7 @@ CopyOrMoveOperationDelegate::CopyOrMoveOperationDelegate(
dest_root_(dest_root),
operation_type_(operation_type),
option_(option),
+ error_behavior_(error_behavior),
progress_callback_(progress_callback),
callback_(callback),
weak_factory_(this) {
@@ -773,7 +775,7 @@ void CopyOrMoveOperationDelegate::RunRecursively() {
// TODO(kinuko): This could be too expensive for same_file_system_==true
// and operation==MOVE case, probably we can just rename the root directory.
// http://crbug.com/172187
- StartRecursiveOperation(src_root_, callback_);
+ StartRecursiveOperation(src_root_, error_behavior_, callback_);
}
void CopyOrMoveOperationDelegate::ProcessFile(
@@ -802,6 +804,10 @@ void CopyOrMoveOperationDelegate::ProcessFile(
file_system_context()->GetCopyOrMoveFileValidatorFactory(
dest_root_.type(), &error);
if (error != base::File::FILE_OK) {
+ if (!progress_callback_.is_null())
+ progress_callback_.Run(FileSystemOperation::ERROR_COPY_ENTRY, src_url,
+ dest_url, 0);
+
callback.Run(error);
return;
}
@@ -900,6 +906,11 @@ void CopyOrMoveOperationDelegate::DidCopyOrMoveFile(
running_copy_set_.erase(impl);
delete impl;
+ if (!progress_callback_.is_null() && error != base::File::FILE_OK &&
+ error != base::File::FILE_ERROR_NOT_A_FILE)
+ progress_callback_.Run(FileSystemOperation::ERROR_COPY_ENTRY, src_url,
+ dest_url, 0);
+
if (!progress_callback_.is_null() && error == base::File::FILE_OK) {
progress_callback_.Run(
FileSystemOperation::END_COPY_ENTRY, src_url, dest_url, 0);
« no previous file with comments | « storage/browser/fileapi/copy_or_move_operation_delegate.h ('k') | storage/browser/fileapi/file_system_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698