OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" |
| 6 |
| 7 #include "base/files/file.h" |
| 8 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 |
| 11 namespace chromeos { |
| 12 namespace file_system_provider { |
| 13 |
| 14 FakeProvidedFileSystem::FakeProvidedFileSystem( |
| 15 const ProvidedFileSystemInfo& file_system_info) |
| 16 : file_system_info_(file_system_info) {} |
| 17 |
| 18 FakeProvidedFileSystem::~FakeProvidedFileSystem() {} |
| 19 |
| 20 bool FakeProvidedFileSystem::RequestUnmount( |
| 21 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
| 22 callback.Run(base::File::FILE_OK); |
| 23 return true; |
| 24 } |
| 25 |
| 26 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() |
| 27 const { |
| 28 return file_system_info_; |
| 29 } |
| 30 |
| 31 FakeProvidedFileSystemFactory::FakeProvidedFileSystemFactory() {} |
| 32 |
| 33 ProvidedFileSystemInterface* FakeProvidedFileSystemFactory::Create( |
| 34 Profile* profile, |
| 35 RequestManager* request_manager, |
| 36 const ProvidedFileSystemInfo& file_system_info) { |
| 37 DCHECK(profile); |
| 38 DCHECK(request_manager); |
| 39 // TODO(mtomasz): Create a request manager in ProvidedFileSystem, since it is |
| 40 // only used by ProvidedFileSystem, instead of having a profile wide one. |
| 41 // As a result, there will be no need to pass the request manager to |
| 42 // ProvidedFileSystemInterface::Create(). |
| 43 return new FakeProvidedFileSystem(file_system_info); |
| 44 } |
| 45 |
| 46 } // namespace file_system_provider |
| 47 } // namespace chromeos |
OLD | NEW |