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

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: Addressed comments. 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..3530236083f0bc337eb35947b9dc8b4ccfd08e27
--- /dev/null
+++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc
@@ -0,0 +1,45 @@
+// 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 "base/message_loop/message_loop_proxy.h"
+#include "chrome/browser/chromeos/file_system_provider/request_manager.h"
+#include "extensions/browser/event_router.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) {
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE, base::Bind(callback, base::File::FILE_OK));
+ return true;
+}
+
+const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo()
+ const {
+ return file_system_info_;
+}
+
+ProvidedFileSystemInterface* FakeProvidedFileSystem::Create(
+ extensions::EventRouter* event_router,
+ RequestManager* request_manager,
+ const ProvidedFileSystemInfo& file_system_info) {
+ // 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 the
+ // factory callback.
+ return new FakeProvidedFileSystem(file_system_info);
+}
+
+} // namespace file_system_provider
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698