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

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: rebase 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
« no previous file with comments | « apps/saved_files_service_factory.h ('k') | apps/saved_files_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c9047702d5af27d8d2e8482055ba11a5185b38e6
--- /dev/null
+++ b/apps/saved_files_service_factory.cc
@@ -0,0 +1,36 @@
+// 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 "components/browser_context_keyed_service/browser_context_dependency_manager.h"
+
+namespace apps {
+
+// static
+SavedFilesService* SavedFilesServiceFactory::GetForProfile(Profile* profile) {
+ return static_cast<SavedFilesService*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+SavedFilesServiceFactory* SavedFilesServiceFactory::GetInstance() {
+ return Singleton<SavedFilesServiceFactory>::get();
+}
+
+SavedFilesServiceFactory::SavedFilesServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "SavedFilesService",
+ BrowserContextDependencyManager::GetInstance()) {}
+
+SavedFilesServiceFactory::~SavedFilesServiceFactory() {}
+
+BrowserContextKeyedService* SavedFilesServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new SavedFilesService(static_cast<Profile*>(profile));
+}
+
+} // namespace apps
« no previous file with comments | « apps/saved_files_service_factory.h ('k') | apps/saved_files_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698