Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Unified Diff: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc

Issue 210803003: [fsp] Decouple file_service_provider::Service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e2cb156ff616531433857f5b5d24d93658871f8c
--- /dev/null
+++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc
@@ -0,0 +1,47 @@
+// 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(
+ 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() {}
+
+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

Powered by Google App Engine
This is Rietveld 408576698