OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "webkit/browser/fileapi/cross_operation_delegate.h" | 5 #include "webkit/browser/fileapi/cross_operation_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "webkit/blob/shareable_file_reference.h" | 9 #include "webkit/blob/shareable_file_reference.h" |
10 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" | 10 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 const FileSystemURL& src_root, | 23 const FileSystemURL& src_root, |
24 const FileSystemURL& dest_root, | 24 const FileSystemURL& dest_root, |
25 OperationType operation_type, | 25 OperationType operation_type, |
26 const StatusCallback& callback) | 26 const StatusCallback& callback) |
27 : RecursiveOperationDelegate(file_system_context, dest_root_operation), | 27 : RecursiveOperationDelegate(file_system_context, dest_root_operation), |
28 src_root_(src_root), | 28 src_root_(src_root), |
29 dest_root_(dest_root), | 29 dest_root_(dest_root), |
30 operation_type_(operation_type), | 30 operation_type_(operation_type), |
31 callback_(callback), | 31 callback_(callback), |
32 src_root_operation_(src_root_operation.Pass()) { | 32 src_root_operation_(src_root_operation.Pass()) { |
33 same_file_system_ = AreSameFileSystem(src_root_, dest_root_); | 33 same_file_system_ = src_root_.IsInSameFileSystem(dest_root_); |
34 } | 34 } |
35 | 35 |
36 CrossOperationDelegate::~CrossOperationDelegate() { | 36 CrossOperationDelegate::~CrossOperationDelegate() { |
37 } | 37 } |
38 | 38 |
39 void CrossOperationDelegate::Run() { | 39 void CrossOperationDelegate::Run() { |
40 // Not supported; this should never be called. | 40 // Not supported; this should never be called. |
41 NOTREACHED(); | 41 NOTREACHED(); |
42 } | 42 } |
43 | 43 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 return NewNestedOperation(); | 237 return NewNestedOperation(); |
238 } | 238 } |
239 | 239 |
240 LocalFileSystemOperation* CrossOperationDelegate::NewSourceOperation() { | 240 LocalFileSystemOperation* CrossOperationDelegate::NewSourceOperation() { |
241 if (same_file_system_) | 241 if (same_file_system_) |
242 return NewDestOperation(); | 242 return NewDestOperation(); |
243 return src_root_operation_->CreateNestedOperation(); | 243 return src_root_operation_->CreateNestedOperation(); |
244 } | 244 } |
245 | 245 |
246 } // namespace fileapi | 246 } // namespace fileapi |
OLD | NEW |