OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_system/browser_file_system_callback_dispatcher.h" | 5 #include "chrome/browser/file_system/browser_file_system_callback_dispatcher.h" |
6 | 6 |
7 #include "chrome/browser/file_system/file_system_dispatcher_host.h" | 7 #include "chrome/browser/file_system/file_system_dispatcher_host.h" |
8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
9 | 9 |
10 BrowserFileSystemCallbackDispatcher::BrowserFileSystemCallbackDispatcher( | 10 BrowserFileSystemCallbackDispatcher::BrowserFileSystemCallbackDispatcher( |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 void BrowserFileSystemCallbackDispatcher::DidReadDirectory( | 31 void BrowserFileSystemCallbackDispatcher::DidReadDirectory( |
32 const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) { | 32 const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) { |
33 dispatcher_host_->Send(new ViewMsg_FileSystem_DidReadDirectory( | 33 dispatcher_host_->Send(new ViewMsg_FileSystem_DidReadDirectory( |
34 request_id_, entries, has_more)); | 34 request_id_, entries, has_more)); |
35 dispatcher_host_->RemoveCompletedOperation(request_id_); | 35 dispatcher_host_->RemoveCompletedOperation(request_id_); |
36 } | 36 } |
37 | 37 |
38 void BrowserFileSystemCallbackDispatcher::DidOpenFileSystem( | 38 void BrowserFileSystemCallbackDispatcher::DidOpenFileSystem( |
39 const std::string&, const FilePath&) { | 39 const std::string& name, const FilePath& path) { |
40 NOTREACHED(); | 40 dispatcher_host_->Send( |
| 41 new ViewMsg_OpenFileSystemRequest_Complete( |
| 42 request_id_, !path.empty(), name, path)); |
| 43 dispatcher_host_->RemoveCompletedOperation(request_id_); |
41 } | 44 } |
42 | 45 |
43 void BrowserFileSystemCallbackDispatcher::DidFail( | 46 void BrowserFileSystemCallbackDispatcher::DidFail( |
44 base::PlatformFileError error_code) { | 47 base::PlatformFileError error_code) { |
45 dispatcher_host_->Send(new ViewMsg_FileSystem_DidFail( | 48 dispatcher_host_->Send(new ViewMsg_FileSystem_DidFail( |
46 request_id_, error_code)); | 49 request_id_, error_code)); |
47 dispatcher_host_->RemoveCompletedOperation(request_id_); | 50 dispatcher_host_->RemoveCompletedOperation(request_id_); |
48 } | 51 } |
49 | 52 |
50 void BrowserFileSystemCallbackDispatcher::DidWrite( | 53 void BrowserFileSystemCallbackDispatcher::DidWrite( |
51 int64 bytes, | 54 int64 bytes, |
52 bool complete) { | 55 bool complete) { |
53 dispatcher_host_->Send(new ViewMsg_FileSystem_DidWrite( | 56 dispatcher_host_->Send(new ViewMsg_FileSystem_DidWrite( |
54 request_id_, bytes, complete)); | 57 request_id_, bytes, complete)); |
55 if (complete) | 58 if (complete) |
56 dispatcher_host_->RemoveCompletedOperation(request_id_); | 59 dispatcher_host_->RemoveCompletedOperation(request_id_); |
57 } | 60 } |
OLD | NEW |