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..d0ce1c9a3bd21f3d9979d91238fe5339ca2a9cef |
--- /dev/null |
+++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc |
@@ -0,0 +1,49 @@ |
+// 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); |
hashimoto
2014/04/14 10:43:42
How about doing something like MessageLoopProxy::c
mtomasz
2014/04/15 02:46:40
Hm. That's an interesting idea. However, calling c
hashimoto
2014/04/15 07:22:45
Calling MessageLoop::Run is discouraged.
Please us
mtomasz
2014/04/15 09:42:12
Done.
|
+ return true; |
+} |
+ |
+const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() |
+ const { |
+ return file_system_info_; |
+} |
+ |
+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 in ProvidedFileSystem, since it is |
+ // only used by ProvidedFileSystem, instead of having a profile wide one. |
+ // As a result, there will be no need to pass the request manager to |
+ // ProvidedFileSystemInterface::Create(). |
+ return new FakeProvidedFileSystem(file_system_info); |
+} |
+ |
+} // namespace file_system_provider |
+} // namespace chromeos |