| 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/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" | 8 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h
" |
| 9 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" |
| 9 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" | 10 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" |
| 10 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" | 11 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
| 11 #include "chrome/common/extensions/api/file_system_provider.h" | 12 #include "chrome/common/extensions/api/file_system_provider.h" |
| 12 #include "extensions/browser/event_router.h" | 13 #include "extensions/browser/event_router.h" |
| 13 | 14 |
| 14 namespace chromeos { | 15 namespace chromeos { |
| 15 namespace file_system_provider { | 16 namespace file_system_provider { |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 } // namespace | 19 } // namespace |
| (...skipping 20 matching lines...) Expand all Loading... |
| 39 const base::FilePath& entry_path, | 40 const base::FilePath& entry_path, |
| 40 const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) { | 41 const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) { |
| 41 if (!request_manager_.CreateRequest( | 42 if (!request_manager_.CreateRequest( |
| 42 make_scoped_ptr<RequestManager::HandlerInterface>( | 43 make_scoped_ptr<RequestManager::HandlerInterface>( |
| 43 new operations::GetMetadata( | 44 new operations::GetMetadata( |
| 44 event_router_, file_system_info_, entry_path, callback)))) { | 45 event_router_, file_system_info_, entry_path, callback)))) { |
| 45 callback.Run(base::File::FILE_ERROR_SECURITY, base::File::Info()); | 46 callback.Run(base::File::FILE_ERROR_SECURITY, base::File::Info()); |
| 46 } | 47 } |
| 47 } | 48 } |
| 48 | 49 |
| 50 void ProvidedFileSystem::ReadDirectory( |
| 51 const base::FilePath& directory_path, |
| 52 const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) { |
| 53 if (!request_manager_.CreateRequest(make_scoped_ptr< |
| 54 RequestManager::HandlerInterface>(new operations::ReadDirectory( |
| 55 event_router_, file_system_info_, directory_path, callback)))) { |
| 56 callback.Run(base::File::FILE_ERROR_SECURITY, |
| 57 fileapi::AsyncFileUtil::EntryList(), |
| 58 false /* has_more */); |
| 59 } |
| 60 } |
| 61 |
| 49 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { | 62 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { |
| 50 return file_system_info_; | 63 return file_system_info_; |
| 51 } | 64 } |
| 52 | 65 |
| 53 RequestManager* ProvidedFileSystem::GetRequestManager() { | 66 RequestManager* ProvidedFileSystem::GetRequestManager() { |
| 54 return &request_manager_; | 67 return &request_manager_; |
| 55 } | 68 } |
| 56 | 69 |
| 57 } // namespace file_system_provider | 70 } // namespace file_system_provider |
| 58 } // namespace chromeos | 71 } // namespace chromeos |
| OLD | NEW |