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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 new operations::CreateDirectory(event_router_, | 143 new operations::CreateDirectory(event_router_, |
143 file_system_info_, | 144 file_system_info_, |
144 directory_path, | 145 directory_path, |
145 exclusive, | 146 exclusive, |
146 recursive, | 147 recursive, |
147 callback)))) { | 148 callback)))) { |
148 callback.Run(base::File::FILE_ERROR_SECURITY); | 149 callback.Run(base::File::FILE_ERROR_SECURITY); |
149 } | 150 } |
150 } | 151 } |
151 | 152 |
| 153 void ProvidedFileSystem::DeleteEntry( |
| 154 const base::FilePath& entry_path, |
| 155 bool recursive, |
| 156 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
| 157 if (!request_manager_.CreateRequest( |
| 158 DELETE_ENTRY, |
| 159 scoped_ptr<RequestManager::HandlerInterface>( |
| 160 new operations::DeleteEntry(event_router_, |
| 161 file_system_info_, |
| 162 entry_path, |
| 163 recursive, |
| 164 callback)))) { |
| 165 callback.Run(base::File::FILE_ERROR_SECURITY); |
| 166 } |
| 167 } |
| 168 |
152 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { | 169 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { |
153 return file_system_info_; | 170 return file_system_info_; |
154 } | 171 } |
155 | 172 |
156 RequestManager* ProvidedFileSystem::GetRequestManager() { | 173 RequestManager* ProvidedFileSystem::GetRequestManager() { |
157 return &request_manager_; | 174 return &request_manager_; |
158 } | 175 } |
159 | 176 |
160 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { | 177 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { |
161 return weak_ptr_factory_.GetWeakPtr(); | 178 return weak_ptr_factory_.GetWeakPtr(); |
162 } | 179 } |
163 | 180 |
164 } // namespace file_system_provider | 181 } // namespace file_system_provider |
165 } // namespace chromeos | 182 } // namespace chromeos |
OLD | NEW |