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

Unified Diff: apps/saved_files_service_factory.cc

Issue 14607023: Add support for persistent file access in apps. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 7 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_factory.cc
diff --git a/apps/saved_files_service_factory.cc b/apps/saved_files_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b87947527ef9d328230894605d24159f934208df
--- /dev/null
+++ b/apps/saved_files_service_factory.cc
@@ -0,0 +1,35 @@
+// Copyright 2013 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_factory.h"
+
+#include "apps/saved_files_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_dependency_manager.h"
+
+namespace apps {
+
+// static
+SavedFilesService* SavedFilesServiceFactory::GetForProfile(Profile* profile) {
+ return static_cast<SavedFilesService*>(
+ GetInstance()->GetServiceForProfile(profile, true));
+}
+
+// static
+SavedFilesServiceFactory* SavedFilesServiceFactory::GetInstance() {
+ return Singleton<SavedFilesServiceFactory>::get();
+}
+
+SavedFilesServiceFactory::SavedFilesServiceFactory()
+ : ProfileKeyedServiceFactory("SavedFilesService",
+ ProfileDependencyManager::GetInstance()) {}
+
+SavedFilesServiceFactory::~SavedFilesServiceFactory() {}
+
+ProfileKeyedService* SavedFilesServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new SavedFilesService(static_cast<Profile*>(profile));
+}
+
+} // namespace apps

Powered by Google App Engine
This is Rietveld 408576698