OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/drive/file_system/copy_operation.h" | 5 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 CopyHostedDocumentToDirectory( | 313 CopyHostedDocumentToDirectory( |
314 dest_file_path.DirName(), | 314 dest_file_path.DirName(), |
315 src_file_proto->resource_id(), | 315 src_file_proto->resource_id(), |
316 // Drop the document extension, which should not be in the title. | 316 // Drop the document extension, which should not be in the title. |
317 // TODO(yoshiki): Remove this code with crbug.com/223304. | 317 // TODO(yoshiki): Remove this code with crbug.com/223304. |
318 dest_file_path.BaseName().RemoveExtension().value(), | 318 dest_file_path.BaseName().RemoveExtension().value(), |
319 callback); | 319 callback); |
320 return; | 320 return; |
321 } | 321 } |
322 | 322 |
323 // TODO(kochi): Reimplement this once the server API supports | |
324 // copying of regular files directly on the server side. crbug.com/138273 | |
325 const base::FilePath& src_file_path = result->first.path; | 323 const base::FilePath& src_file_path = result->first.path; |
326 file_system_->GetFileByPath( | 324 file_system_->GetFileByPath( |
327 src_file_path, | 325 src_file_path, |
328 base::Bind(&CopyOperation::OnGetFileCompleteForCopy, | 326 base::Bind(&CopyOperation::OnGetFileCompleteForCopy, |
329 weak_ptr_factory_.GetWeakPtr(), | 327 weak_ptr_factory_.GetWeakPtr(), |
330 dest_file_path, | 328 dest_file_path, |
331 callback)); | 329 callback)); |
332 } | 330 } |
333 | 331 |
334 void CopyOperation::OnCopyResourceCompleted( | 332 void CopyOperation::OnCopyResourceCompleted( |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 canonicalized_resource_id, | 436 canonicalized_resource_id, |
439 // Drop the document extension, which should not be | 437 // Drop the document extension, which should not be |
440 // in the document title. | 438 // in the document title. |
441 // TODO(yoshiki): Remove this code with crbug.com/223304. | 439 // TODO(yoshiki): Remove this code with crbug.com/223304. |
442 remote_dest_file_path.BaseName().RemoveExtension().value(), | 440 remote_dest_file_path.BaseName().RemoveExtension().value(), |
443 callback); | 441 callback); |
444 } | 442 } |
445 | 443 |
446 } // namespace file_system | 444 } // namespace file_system |
447 } // namespace drive | 445 } // namespace drive |
OLD | NEW |