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

Unified Diff: apps/saved_files_service_delegate_impl.cc

Issue 2934143002: Move chrome.fileSystem implementation to //extensions (Closed)
Patch Set: benwells, test fix Created 3 years, 6 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: apps/saved_files_service_delegate_impl.cc
diff --git a/apps/saved_files_service_delegate_impl.cc b/apps/saved_files_service_delegate_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1a2845bf524fc4517b2dfafebbbf215e97205f99
--- /dev/null
+++ b/apps/saved_files_service_delegate_impl.cc
@@ -0,0 +1,52 @@
+// Copyright 2017 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 "apps/saved_files_service_delegate_impl.h"
+
+#include "apps/saved_files_service.h"
+#include "content/public/browser/browser_context.h"
+
+namespace apps {
+
+SavedFilesServiceDelegateImpl::SavedFilesServiceDelegateImpl(
+ content::BrowserContext* browser_context) {
+ saved_files_service_ = SavedFilesService::Get(browser_context);
Devlin 2017/06/14 14:53:21 why not initialize this in the initializer list?
+}
+
+SavedFilesServiceDelegateImpl::~SavedFilesServiceDelegateImpl() {}
+
+bool SavedFilesServiceDelegateImpl::IsRegistered(
+ const std::string& extension_id,
+ const std::string& id) {
+ return saved_files_service_->IsRegistered(extension_id, id);
+}
+
+void SavedFilesServiceDelegateImpl::RegisterFileEntry(
+ const std::string& extension_id,
+ const File& file) {
+ saved_files_service_->RegisterFileEntry(extension_id, file.id, file.path,
+ file.is_directory);
+}
+
+bool SavedFilesServiceDelegateImpl::GetRegisteredFileInfo(
+ const std::string& extension_id,
+ const std::string& id,
+ File* file) {
+ const SavedFileEntry* entry =
+ saved_files_service_->GetFileEntry(extension_id, id);
+ if (!entry)
+ return false;
+ file->id = entry->id;
+ file->path = entry->path;
+ file->is_directory = entry->is_directory;
+ return true;
+}
+
+void SavedFilesServiceDelegateImpl::EnqueueFileEntry(
+ const std::string& extension_id,
+ const std::string& id) {
+ saved_files_service_->EnqueueFileEntry(extension_id, id);
+}
+
+} // namespace apps

Powered by Google App Engine
This is Rietveld 408576698