OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/file_system_provider/provided_file_system.h" | 5 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "chrome/browser/chromeos/file_system_provider/notification_manager.h" | 9 #include "chrome/browser/chromeos/file_system_provider/notification_manager.h" |
10 #include "chrome/browser/chromeos/file_system_provider/operations/close_file.h" | 10 #include "chrome/browser/chromeos/file_system_provider/operations/close_file.h" |
11 #include "chrome/browser/chromeos/file_system_provider/operations/copy_entry.h" | 11 #include "chrome/browser/chromeos/file_system_provider/operations/copy_entry.h" |
12 #include "chrome/browser/chromeos/file_system_provider/operations/create_directo
ry.h" | 12 #include "chrome/browser/chromeos/file_system_provider/operations/create_directo
ry.h" |
13 #include "chrome/browser/chromeos/file_system_provider/operations/create_file.h" | 13 #include "chrome/browser/chromeos/file_system_provider/operations/create_file.h" |
14 #include "chrome/browser/chromeos/file_system_provider/operations/delete_entry.h
" | 14 #include "chrome/browser/chromeos/file_system_provider/operations/delete_entry.h
" |
15 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" | 15 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" |
| 16 #include "chrome/browser/chromeos/file_system_provider/operations/move_entry.h" |
16 #include "chrome/browser/chromeos/file_system_provider/operations/open_file.h" | 17 #include "chrome/browser/chromeos/file_system_provider/operations/open_file.h" |
17 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" | 18 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" |
18 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" | 19 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" |
19 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" | 20 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" |
20 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" | 21 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
21 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/common/extensions/api/file_system_provider.h" | 23 #include "chrome/common/extensions/api/file_system_provider.h" |
23 #include "extensions/browser/event_router.h" | 24 #include "extensions/browser/event_router.h" |
24 | 25 |
25 namespace net { | 26 namespace net { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 scoped_ptr<RequestManager::HandlerInterface>( | 190 scoped_ptr<RequestManager::HandlerInterface>( |
190 new operations::CopyEntry(event_router_, | 191 new operations::CopyEntry(event_router_, |
191 file_system_info_, | 192 file_system_info_, |
192 source_path, | 193 source_path, |
193 target_path, | 194 target_path, |
194 callback)))) { | 195 callback)))) { |
195 callback.Run(base::File::FILE_ERROR_SECURITY); | 196 callback.Run(base::File::FILE_ERROR_SECURITY); |
196 } | 197 } |
197 } | 198 } |
198 | 199 |
| 200 void ProvidedFileSystem::MoveEntry( |
| 201 const base::FilePath& source_path, |
| 202 const base::FilePath& target_path, |
| 203 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
| 204 if (!request_manager_.CreateRequest( |
| 205 MOVE_ENTRY, |
| 206 scoped_ptr<RequestManager::HandlerInterface>( |
| 207 new operations::MoveEntry(event_router_, |
| 208 file_system_info_, |
| 209 source_path, |
| 210 target_path, |
| 211 callback)))) { |
| 212 callback.Run(base::File::FILE_ERROR_SECURITY); |
| 213 } |
| 214 } |
| 215 |
199 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { | 216 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { |
200 return file_system_info_; | 217 return file_system_info_; |
201 } | 218 } |
202 | 219 |
203 RequestManager* ProvidedFileSystem::GetRequestManager() { | 220 RequestManager* ProvidedFileSystem::GetRequestManager() { |
204 return &request_manager_; | 221 return &request_manager_; |
205 } | 222 } |
206 | 223 |
207 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { | 224 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { |
208 return weak_ptr_factory_.GetWeakPtr(); | 225 return weak_ptr_factory_.GetWeakPtr(); |
209 } | 226 } |
210 | 227 |
211 } // namespace file_system_provider | 228 } // namespace file_system_provider |
212 } // namespace chromeos | 229 } // namespace chromeos |
OLD | NEW |