Chromium Code Reviews| Index: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc |
| diff --git a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0044916922f4221f26d8ba840871ae7d653a1c5d |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h" |
| + |
| +#include "base/files/file.h" |
| +#include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
| +#include "chrome/browser/profiles/profile.h" |
| + |
| +namespace chromeos { |
| +namespace file_system_provider { |
| + |
| +FakeProvidedFileSystem::FakeProvidedFileSystem() {} |
| + |
| +FakeProvidedFileSystem::FakeProvidedFileSystem( |
| + const ProvidedFileSystemInfo& file_system_info) |
| + : file_system_info_(file_system_info) {} |
| + |
| +FakeProvidedFileSystem::~FakeProvidedFileSystem() {} |
| + |
| +bool FakeProvidedFileSystem::RequestUnmount( |
| + const fileapi::AsyncFileUtil::StatusCallback& callback) { |
| + callback.Run(base::File::FILE_OK); |
| + return true; |
| +} |
| + |
| +const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() |
| + const { |
| + return file_system_info_; |
| +} |
| + |
| +FakeProvidedFileSystemFactory::FakeProvidedFileSystemFactory() {} |
| + |
| +FakeProvidedFileSystemFactory::~FakeProvidedFileSystemFactory() {} |
| + |
| +ProvidedFileSystemInterface* FakeProvidedFileSystemFactory::Create( |
| + Profile* profile, |
| + RequestManager* request_manager, |
| + const ProvidedFileSystemInfo& file_system_info) { |
| + DCHECK(profile); |
| + DCHECK(request_manager); |
| + // TODO(mtomasz): Create a request manager per provided file system, instead |
| + // of a profile wide. As a result, this dependency will not be needed in a |
|
hashimoto
2014/04/11 06:01:50
nit: What does "this dependency" mean?
mtomasz
2014/04/11 19:54:12
Dependency of the fake factory on the request mana
|
| + // fake implementation. |
| + return new FakeProvidedFileSystem(file_system_info); |
| +} |
| + |
| +} // namespace file_system_provider |
| +} // namespace chromeos |