summaryrefslogtreecommitdiffstats
path: root/chrome/browser/file_system
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 04:07:29 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 04:07:29 +0000
commit7c1cf47e757207d6c90a5954ced27c2d108bc7b4 (patch)
treec1953598151e167bb1831c96e749c8814aee6e50 /chrome/browser/file_system
parentfe9dbd662522c686fcdb33b0e89c0aafa268b68f (diff)
downloadchromium_src-7c1cf47e757207d6c90a5954ced27c2d108bc7b4.zip
chromium_src-7c1cf47e757207d6c90a5954ced27c2d108bc7b4.tar.gz
chromium_src-7c1cf47e757207d6c90a5954ced27c2d108bc7b4.tar.bz2
Add final part of IPC plumbing for FileSystem API (retry).
Original issue: http://codereview.chromium.org/3208007/show (Reverted due to rebase error) BUG=32277 TEST=none; to be added when we have complete implementation. TBR=phajdan-jr, michaeln Review URL: http://codereview.chromium.org/3256006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57955 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/file_system')
-rw-r--r--chrome/browser/file_system/file_system_dispatcher_host.cc62
-rw-r--r--chrome/browser/file_system/file_system_dispatcher_host.h25
2 files changed, 81 insertions, 6 deletions
diff --git a/chrome/browser/file_system/file_system_dispatcher_host.cc b/chrome/browser/file_system/file_system_dispatcher_host.cc
index d876808..172217e 100644
--- a/chrome/browser/file_system/file_system_dispatcher_host.cc
+++ b/chrome/browser/file_system/file_system_dispatcher_host.cc
@@ -50,7 +50,12 @@ bool FileSystemDispatcherHost::OnMessageReceived(
IPC_BEGIN_MESSAGE_MAP_EX(FileSystemDispatcherHost, message, *message_was_ok)
IPC_MESSAGE_HANDLER(ViewHostMsg_OpenFileSystemRequest, OnOpenFileSystem)
IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Move, OnMove)
- // TODO(kinuko): add more.
+ IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Copy, OnCopy)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Remove, OnRemove)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_ReadMetadata, OnReadMetadata)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Create, OnCreate)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Exists, OnExists)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_ReadDirectory, OnReadDirectory)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
return handled;
@@ -93,14 +98,65 @@ void FileSystemDispatcherHost::OnMove(
webkit_glue::WebStringToFilePath(src_path)) ||
!context_->CheckValidFileSystemPath(
webkit_glue::WebStringToFilePath(dest_path))) {
- Send(new ViewMsg_FileSystem_Failed(
+ Send(new ViewMsg_FileSystem_DidFail(
request_id, WebKit::WebFileErrorSecurity));
return;
}
// TODO(kinuko): not implemented yet.
+ Send(new ViewMsg_FileSystem_DidFail(
+ request_id, WebKit::WebFileErrorAbort));
+}
+
+void FileSystemDispatcherHost::OnCopy(
+ int request_id,
+ const string16& src_path,
+ const string16& dest_path) {
+ // TODO(kinuko): not implemented yet.
+ Send(new ViewMsg_FileSystem_DidFail(
+ request_id, WebKit::WebFileErrorAbort));
+}
- Send(new ViewMsg_FileSystem_Failed(
+void FileSystemDispatcherHost::OnRemove(
+ int request_id,
+ const string16& path) {
+ // TODO(kinuko): not implemented yet.
+ Send(new ViewMsg_FileSystem_DidFail(
+ request_id, WebKit::WebFileErrorAbort));
+}
+
+void FileSystemDispatcherHost::OnReadMetadata(
+ int request_id,
+ const string16& path) {
+ // TODO(kinuko): not implemented yet.
+ Send(new ViewMsg_FileSystem_DidFail(
+ request_id, WebKit::WebFileErrorAbort));
+}
+
+void FileSystemDispatcherHost::OnCreate(
+ int request_id,
+ const string16& path,
+ bool exclusive,
+ bool is_directory) {
+ // TODO(kinuko): not implemented yet.
+ Send(new ViewMsg_FileSystem_DidFail(
+ request_id, WebKit::WebFileErrorAbort));
+}
+
+void FileSystemDispatcherHost::OnExists(
+ int request_id,
+ const string16& path,
+ bool is_directory) {
+ // TODO(kinuko): not implemented yet.
+ Send(new ViewMsg_FileSystem_DidFail(
+ request_id, WebKit::WebFileErrorAbort));
+}
+
+void FileSystemDispatcherHost::OnReadDirectory(
+ int request_id,
+ const string16& path) {
+ // TODO(kinuko): not implemented yet.
+ Send(new ViewMsg_FileSystem_DidFail(
request_id, WebKit::WebFileErrorAbort));
}
diff --git a/chrome/browser/file_system/file_system_dispatcher_host.h b/chrome/browser/file_system/file_system_dispatcher_host.h
index 0f8b63a..320e56a 100644
--- a/chrome/browser/file_system/file_system_dispatcher_host.h
+++ b/chrome/browser/file_system/file_system_dispatcher_host.h
@@ -32,9 +32,28 @@ class FileSystemDispatcherHost
int request_id,
const string16& src_path,
const string16& dest_path);
-
- // TODO(kinuko): add more methods.
-
+ void OnCopy(
+ int request_id,
+ const string16& src_path,
+ const string16& dest_path);
+ void OnRemove(
+ int request_id,
+ const string16& path);
+ void OnReadMetadata(
+ int request_id,
+ const string16& path);
+ void OnCreate(
+ int request_id,
+ const string16& path,
+ bool exclusive,
+ bool is_directory);
+ void OnExists(
+ int request_id,
+ const string16& path,
+ bool is_directory);
+ void OnReadDirectory(
+ int request_id,
+ const string16& path);
void Send(IPC::Message* message);
private: