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/create_directo
ry.h" | 12 #include "chrome/browser/chromeos/file_system_provider/operations/create_directo
ry.h" |
12 #include "chrome/browser/chromeos/file_system_provider/operations/create_file.h" | 13 #include "chrome/browser/chromeos/file_system_provider/operations/create_file.h" |
13 #include "chrome/browser/chromeos/file_system_provider/operations/delete_entry.h
" | 14 #include "chrome/browser/chromeos/file_system_provider/operations/delete_entry.h
" |
14 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" | 15 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" |
15 #include "chrome/browser/chromeos/file_system_provider/operations/open_file.h" | 16 #include "chrome/browser/chromeos/file_system_provider/operations/open_file.h" |
16 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" | 17 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" |
17 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" | 18 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" |
18 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" | 19 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" |
19 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" | 20 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 const fileapi::AsyncFileUtil::StatusCallback& callback) { | 173 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
173 if (!request_manager_.CreateRequest( | 174 if (!request_manager_.CreateRequest( |
174 CREATE_FILE, | 175 CREATE_FILE, |
175 scoped_ptr<RequestManager::HandlerInterface>( | 176 scoped_ptr<RequestManager::HandlerInterface>( |
176 new operations::CreateFile( | 177 new operations::CreateFile( |
177 event_router_, file_system_info_, file_path, callback)))) { | 178 event_router_, file_system_info_, file_path, callback)))) { |
178 callback.Run(base::File::FILE_ERROR_SECURITY); | 179 callback.Run(base::File::FILE_ERROR_SECURITY); |
179 } | 180 } |
180 } | 181 } |
181 | 182 |
| 183 void ProvidedFileSystem::CopyEntry( |
| 184 const base::FilePath& source_path, |
| 185 const base::FilePath& target_path, |
| 186 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
| 187 if (!request_manager_.CreateRequest( |
| 188 COPY_ENTRY, |
| 189 scoped_ptr<RequestManager::HandlerInterface>( |
| 190 new operations::CopyEntry(event_router_, |
| 191 file_system_info_, |
| 192 source_path, |
| 193 target_path, |
| 194 callback)))) { |
| 195 callback.Run(base::File::FILE_ERROR_SECURITY); |
| 196 } |
| 197 } |
| 198 |
182 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { | 199 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { |
183 return file_system_info_; | 200 return file_system_info_; |
184 } | 201 } |
185 | 202 |
186 RequestManager* ProvidedFileSystem::GetRequestManager() { | 203 RequestManager* ProvidedFileSystem::GetRequestManager() { |
187 return &request_manager_; | 204 return &request_manager_; |
188 } | 205 } |
189 | 206 |
190 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { | 207 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { |
191 return weak_ptr_factory_.GetWeakPtr(); | 208 return weak_ptr_factory_.GetWeakPtr(); |
192 } | 209 } |
193 | 210 |
194 } // namespace file_system_provider | 211 } // namespace file_system_provider |
195 } // namespace chromeos | 212 } // namespace chromeos |
OLD | NEW |