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/get_metadata.h
" | 12 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" |
12 #include "chrome/browser/chromeos/file_system_provider/operations/open_file.h" | 13 #include "chrome/browser/chromeos/file_system_provider/operations/open_file.h" |
13 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" | 14 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" |
14 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" | 15 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.h" |
15 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" | 16 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" |
16 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" | 17 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/common/extensions/api/file_system_provider.h" | 19 #include "chrome/common/extensions/api/file_system_provider.h" |
19 #include "extensions/browser/event_router.h" | 20 #include "extensions/browser/event_router.h" |
20 | 21 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 const fileapi::AsyncFileUtil::StatusCallback& callback) { | 127 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
127 if (!request_manager_.CreateRequest( | 128 if (!request_manager_.CreateRequest( |
128 CLOSE_FILE, | 129 CLOSE_FILE, |
129 scoped_ptr<RequestManager::HandlerInterface>( | 130 scoped_ptr<RequestManager::HandlerInterface>( |
130 new operations::CloseFile( | 131 new operations::CloseFile( |
131 event_router_, file_system_info_, file_handle, callback)))) { | 132 event_router_, file_system_info_, file_handle, callback)))) { |
132 callback.Run(base::File::FILE_ERROR_SECURITY); | 133 callback.Run(base::File::FILE_ERROR_SECURITY); |
133 } | 134 } |
134 } | 135 } |
135 | 136 |
| 137 void ProvidedFileSystem::CreateDirectory( |
| 138 const base::FilePath& directory_path, |
| 139 bool exclusive, |
| 140 bool recursive, |
| 141 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
| 142 if (!request_manager_.CreateRequest( |
| 143 CREATE_DIRECTORY, |
| 144 scoped_ptr<RequestManager::HandlerInterface>( |
| 145 new operations::CreateDirectory(event_router_, |
| 146 file_system_info_, |
| 147 directory_path, |
| 148 exclusive, |
| 149 recursive, |
| 150 callback)))) { |
| 151 callback.Run(base::File::FILE_ERROR_SECURITY); |
| 152 } |
| 153 } |
| 154 |
136 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { | 155 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { |
137 return file_system_info_; | 156 return file_system_info_; |
138 } | 157 } |
139 | 158 |
140 RequestManager* ProvidedFileSystem::GetRequestManager() { | 159 RequestManager* ProvidedFileSystem::GetRequestManager() { |
141 return &request_manager_; | 160 return &request_manager_; |
142 } | 161 } |
143 | 162 |
144 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { | 163 base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { |
145 return weak_ptr_factory_.GetWeakPtr(); | 164 return weak_ptr_factory_.GetWeakPtr(); |
146 } | 165 } |
147 | 166 |
148 } // namespace file_system_provider | 167 } // namespace file_system_provider |
149 } // namespace chromeos | 168 } // namespace chromeos |
OLD | NEW |