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

Unified Diff: chrome/browser/chromeos/file_system_provider/file_system_plugin/plugin_service_factory.cc

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved several modules to chromeos folder. Created 5 years, 5 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/file_system_plugin/plugin_service_factory.cc
diff --git a/chrome/browser/chromeos/file_system_provider/file_system_plugin/plugin_service_factory.cc b/chrome/browser/chromeos/file_system_provider/file_system_plugin/plugin_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c0b3510eb64e73afbe311958054ee765ff7d52eb
--- /dev/null
+++ b/chrome/browser/chromeos/file_system_provider/file_system_plugin/plugin_service_factory.cc
@@ -0,0 +1,49 @@
+// Copyright 2015 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/file_system_plugin/plugin_service_factory.h"
+
+#include "chrome/browser/chromeos/file_system_provider/file_system_plugin/plugin_service.h"
+#include "chrome/browser/profiles/incognito_helpers.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+namespace chromeos {
+namespace file_system_provider {
+// static
+PluginService* PluginServiceFactory::Get(content::BrowserContext *context) {
+ return static_cast<PluginService*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+// static
+PluginServiceFactory* PluginServiceFactory::GetInstance() {
+ return Singleton<PluginServiceFactory>::get();
+}
+
+PluginServiceFactory::PluginServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "Plugin_Service",
+ BrowserContextDependencyManager::GetInstance()) {
+// No dependencies yet
+}
+
+PluginServiceFactory::~PluginServiceFactory() {}
+
+KeyedService* PluginServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new PluginService(Profile::FromBrowserContext(profile));
+}
+
+bool PluginServiceFactory::ServiceIsCreatedWithBrowserContext() const {
+ return true;
+}
+
+content::BrowserContext* PluginServiceFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return chrome::GetBrowserContextRedirectedInIncognito(context);
+}
+
+} // namespace file_system_provider
+} // namespace chromeos
+

Powered by Google App Engine
This is Rietveld 408576698