summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/chromeos/gdata/drive_file_system_proxy.cc13
-rw-r--r--chrome/browser/chromeos/gdata/drive_file_system_proxy.h7
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_operation.cc8
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_proxy.h9
4 files changed, 34 insertions, 3 deletions
diff --git a/chrome/browser/chromeos/gdata/drive_file_system_proxy.cc b/chrome/browser/chromeos/gdata/drive_file_system_proxy.cc
index 5314d3c..a201a9a 100644
--- a/chrome/browser/chromeos/gdata/drive_file_system_proxy.cc
+++ b/chrome/browser/chromeos/gdata/drive_file_system_proxy.cc
@@ -554,6 +554,19 @@ void DriveFileSystemProxy::NotifyCloseFile(const FileSystemURL& url) {
base::Bind(&EmitDebugLogForCloseFile, file_path));
}
+void DriveFileSystemProxy::TouchFile(
+ const fileapi::FileSystemURL& url,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time,
+ const FileSystemOperation::StatusCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ // TODO(kinaba,kochi): crbug.com/144369. Support this operations once we have
+ // migrated to the new Drive API.
+ MessageLoopProxy::current()->PostTask(FROM_HERE,
+ base::Bind(callback, base::PLATFORM_FILE_ERROR_INVALID_OPERATION));
+}
+
void DriveFileSystemProxy::CreateSnapshotFile(
const FileSystemURL& file_url,
const FileSystemOperation::SnapshotFileCallback& callback) {
diff --git a/chrome/browser/chromeos/gdata/drive_file_system_proxy.h b/chrome/browser/chromeos/gdata/drive_file_system_proxy.h
index 0c63eb0..88eb045b 100644
--- a/chrome/browser/chromeos/gdata/drive_file_system_proxy.h
+++ b/chrome/browser/chromeos/gdata/drive_file_system_proxy.h
@@ -77,7 +77,12 @@ class DriveFileSystemProxy : public fileapi::RemoteFileSystemProxyInterface {
const fileapi::FileSystemOperation::OpenFileCallback&
callback) OVERRIDE;
virtual void NotifyCloseFile(const fileapi::FileSystemURL& url) OVERRIDE;
- // TODO(zelidrag): More methods to follow as we implement other parts of FSO.
+ virtual void TouchFile(
+ const fileapi::FileSystemURL& url,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time,
+ const fileapi::FileSystemOperation::StatusCallback& callback)
+ OVERRIDE;
protected:
virtual ~DriveFileSystemProxy();
diff --git a/webkit/chromeos/fileapi/remote_file_system_operation.cc b/webkit/chromeos/fileapi/remote_file_system_operation.cc
index 7f9190b..23f687a 100644
--- a/webkit/chromeos/fileapi/remote_file_system_operation.cc
+++ b/webkit/chromeos/fileapi/remote_file_system_operation.cc
@@ -177,7 +177,13 @@ void RemoteFileSystemOperation::TouchFile(const FileSystemURL& url,
const base::Time& last_access_time,
const base::Time& last_modified_time,
const StatusCallback& callback) {
- NOTIMPLEMENTED();
+ DCHECK(SetPendingOperationType(kOperationTouchFile));
+ remote_proxy_->TouchFile(
+ url,
+ last_access_time,
+ last_modified_time,
+ base::Bind(&RemoteFileSystemOperation::DidFinishFileOperation,
+ base::Owned(this), callback));
}
void RemoteFileSystemOperation::OpenFile(const FileSystemURL& url,
diff --git a/webkit/chromeos/fileapi/remote_file_system_proxy.h b/webkit/chromeos/fileapi/remote_file_system_proxy.h
index 5237e405..e54a266 100644
--- a/webkit/chromeos/fileapi/remote_file_system_proxy.h
+++ b/webkit/chromeos/fileapi/remote_file_system_proxy.h
@@ -103,7 +103,14 @@ class RemoteFileSystemProxyInterface :
// Notifies that a file opened by OpenFile (at |path|) is closed.
virtual void NotifyCloseFile(const FileSystemURL& url) = 0;
- // TODO(zelidrag): More methods to follow as we implement other parts of FSO.
+ // Modifies the timestamp of a given |url| to |last_access_time| and
+ // |last_modified_time|. Note that unlike 'touch' command of Linux, it
+ // does not create a new file.
+ virtual void TouchFile(
+ const fileapi::FileSystemURL& url,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time,
+ const FileSystemOperation::StatusCallback& callback) = 0;
protected:
friend class base::RefCountedThreadSafe<RemoteFileSystemProxyInterface>;