Index: components/arc/arc_bridge_service_factory.cc |
diff --git a/components/arc/arc_bridge_service_factory.cc b/components/arc/arc_bridge_service_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..035d7539461a8cf7c9a774f5e5d8aa04efb660cd |
--- /dev/null |
+++ b/components/arc/arc_bridge_service_factory.cc |
@@ -0,0 +1,42 @@ |
+// Copyright (c) 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 "components/arc/arc_bridge_service_factory.h" |
+ |
+#include "components/arc/arc_bridge_service.h" |
+#include "components/keyed_service/content/browser_context_dependency_manager.h" |
+#include "content/public/browser/browser_thread.h" |
+ |
+namespace arc { |
+ |
+// static |
+ArcBridgeService* ArcBridgeServiceFactory::GetForBrowserContext( |
+ content::BrowserContext* context) { |
+ return static_cast<ArcBridgeService*>( |
+ GetInstance()->GetServiceForBrowserContext(context, true)); |
+} |
+ |
+ArcBridgeServiceFactory* ArcBridgeServiceFactory::GetInstance() { |
+ return base::Singleton<ArcBridgeServiceFactory>::get(); |
+} |
+ |
+ArcBridgeServiceFactory::ArcBridgeServiceFactory() |
+ : BrowserContextKeyedServiceFactory( |
+ "ArcBridgeService", |
+ BrowserContextDependencyManager::GetInstance()) {} |
+ |
+ArcBridgeServiceFactory::~ArcBridgeServiceFactory() {} |
+ |
+KeyedService* ArcBridgeServiceFactory::BuildServiceInstanceFor( |
+ content::BrowserContext* profile) const { |
+ return new ArcBridgeService( |
+ content::BrowserThread::GetMessageLoopProxyForThread( |
+ content::BrowserThread::FILE)); |
+} |
+ |
+bool ArcBridgeServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
+ return true; |
+} |
+ |
+} // namespace arc |