Index: chromeos/arc/bridge/arc_bridge_service_factory.cc |
diff --git a/chromeos/arc/bridge/arc_bridge_service_factory.cc b/chromeos/arc/bridge/arc_bridge_service_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..272b2661ba8215d1f9243a6235c9173c8bf60b91 |
--- /dev/null |
+++ b/chromeos/arc/bridge/arc_bridge_service_factory.cc |
@@ -0,0 +1,39 @@ |
+// 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 "chromeos/arc/bridge/arc_bridge_service_factory.h" |
+ |
+#include "chrome/browser/profiles/profile.h" |
+#include "chromeos/arc/bridge/arc_bridge_service.h" |
+#include "components/keyed_service/content/browser_context_dependency_manager.h" |
+ |
+namespace arc { |
+ |
+// static |
+ArcBridgeService* ArcBridgeServiceFactory::GetForProfile(Profile* profile) { |
+ return static_cast<ArcBridgeService*>( |
+ GetInstance()->GetServiceForBrowserContext(profile, 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(static_cast<Profile*>(profile)); |
+} |
+ |
+bool ArcBridgeServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
+ return true; |
+} |
+ |
+} // namespace arc |