| 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/create_directo
ry.h" | 11 #include "chrome/browser/chromeos/file_system_provider/operations/create_directo
ry.h" |
| 12 #include "chrome/browser/chromeos/file_system_provider/operations/delete_entry.h
" |
| 12 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" | 13 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" |
| 13 #include "chrome/browser/chromeos/file_system_provider/operations/open_file.h" | 14 #include "chrome/browser/chromeos/file_system_provider/operations/open_file.h" |
| 14 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" | 15 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" |
| 15 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" | 16 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" |
| 16 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" | 17 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" |
| 17 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" | 18 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/common/extensions/api/file_system_provider.h" | 20 #include "chrome/common/extensions/api/file_system_provider.h" |
| 20 #include "extensions/browser/event_router.h" | 21 #include "extensions/browser/event_router.h" |
| 21 | 22 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 new operations::CreateDirectory(event_router_, | 146 new operations::CreateDirectory(event_router_, |
| 146 file_system_info_, | 147 file_system_info_, |
| 147 directory_path, | 148 directory_path, |
| 148 exclusive, | 149 exclusive, |
| 149 recursive, | 150 recursive, |
| 150 callback)))) { | 151 callback)))) { |
| 151 callback.Run(base::File::FILE_ERROR_SECURITY); | 152 callback.Run(base::File::FILE_ERROR_SECURITY); |
| 152 } | 153 } |
| 153 } | 154 } |
| 154 | 155 |
| 156 void ProvidedFileSystem::DeleteEntry( |
| 157 const base::FilePath& entry_path, |
| 158 bool recursive, |
| 159 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
| 160 if (!request_manager_.CreateRequest( |
| 161 DELETE_ENTRY, |
| 162 scoped_ptr<RequestManager::HandlerInterface>( |
| 163 new operations::DeleteEntry(event_router_, |
| 164 file_system_info_, |
| 165 entry_path, |
| 166 recursive, |
| 167 callback)))) { |
| 168 callback.Run(base::File::FILE_ERROR_SECURITY); |
| 169 } |
| 170 } |
| 171 |
| 155 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { | 172 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { |
| 156 return file_system_info_; | 173 return file_system_info_; |
| 157 } | 174 } |
| 158 | 175 |
| 159 RequestManager* ProvidedFileSystem::GetRequestManager() { | 176 RequestManager* ProvidedFileSystem::GetRequestManager() { |
| 160 return &request_manager_; | 177 return &request_manager_; |
| 161 } | 178 } |
| 162 | 179 |
| 163 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { | 180 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { |
| 164 return weak_ptr_factory_.GetWeakPtr(); | 181 return weak_ptr_factory_.GetWeakPtr(); |
| 165 } | 182 } |
| 166 | 183 |
| 167 } // namespace file_system_provider | 184 } // namespace file_system_provider |
| 168 } // namespace chromeos | 185 } // namespace chromeos |
| OLD | NEW |