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_proxy.h" | 5 #include "chrome/browser/chromeos/drive/file_system_proxy.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 file_path)))); | 613 file_path)))); |
614 } | 614 } |
615 | 615 |
616 void FileSystemProxy::TouchFile( | 616 void FileSystemProxy::TouchFile( |
617 const fileapi::FileSystemURL& url, | 617 const fileapi::FileSystemURL& url, |
618 const base::Time& last_access_time, | 618 const base::Time& last_access_time, |
619 const base::Time& last_modified_time, | 619 const base::Time& last_modified_time, |
620 const FileSystemOperation::StatusCallback& callback) { | 620 const FileSystemOperation::StatusCallback& callback) { |
621 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 621 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
622 | 622 |
623 // TODO(kinaba,kochi): crbug.com/144369. Support this operations once we have | 623 base::FilePath file_path; |
624 // migrated to the new Drive API. | 624 if (!ValidateUrl(url, &file_path)) |
625 MessageLoopProxy::current()->PostTask( | 625 return; |
626 FROM_HERE, | 626 |
627 base::Bind(callback, base::PLATFORM_FILE_ERROR_INVALID_OPERATION)); | 627 CallFileSystemMethodOnUIThread( |
| 628 base::Bind(&FileSystemInterface::TouchFile, |
| 629 base::Unretained(file_system_), |
| 630 file_path, last_access_time, last_modified_time, |
| 631 google_apis::CreateRelayCallback( |
| 632 base::Bind(&FileSystemProxy::OnStatusCallback, |
| 633 this, |
| 634 callback)))); |
628 } | 635 } |
629 | 636 |
630 void FileSystemProxy::CreateSnapshotFile( | 637 void FileSystemProxy::CreateSnapshotFile( |
631 const FileSystemURL& file_url, | 638 const FileSystemURL& file_url, |
632 const FileSystemOperation::SnapshotFileCallback& callback) { | 639 const FileSystemOperation::SnapshotFileCallback& callback) { |
633 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 640 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
634 | 641 |
635 base::FilePath file_path; | 642 base::FilePath file_path; |
636 if (!ValidateUrl(file_url, &file_path)) { | 643 if (!ValidateUrl(file_url, &file_path)) { |
637 MessageLoopProxy::current()->PostTask( | 644 MessageLoopProxy::current()->PostTask( |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 base::Bind(&EmitDebugLogForCloseFile, | 865 base::Bind(&EmitDebugLogForCloseFile, |
859 virtual_path)))); | 866 virtual_path)))); |
860 } | 867 } |
861 | 868 |
862 FileSystemInterface* FileSystemProxy::GetFileSystemOnUIThread() { | 869 FileSystemInterface* FileSystemProxy::GetFileSystemOnUIThread() { |
863 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 870 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
864 return file_system_; | 871 return file_system_; |
865 } | 872 } |
866 | 873 |
867 } // namespace drive | 874 } // namespace drive |
OLD | NEW |