Index: components/arc/arc_bridge_service_factory.h |
diff --git a/components/arc/arc_bridge_service_factory.h b/components/arc/arc_bridge_service_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..156a55d0f25ae2f4bc514ff2166ad1036c4dd199 |
--- /dev/null |
+++ b/components/arc/arc_bridge_service_factory.h |
@@ -0,0 +1,43 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
hidehiko
2015/10/28 17:48:45
nit: s/2012/2015/ :-).
Luis Héctor Chávez
2015/10/28 21:06:32
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_FACTORY_H_ |
+#define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_FACTORY_H_ |
+ |
+#include "base/memory/singleton.h" |
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
+ |
+namespace content { |
+class BrowserContext; |
+} |
+ |
+namespace arc { |
+ |
+class ArcBridgeService; |
+ |
+// Singleton that owns all ArcBridgeServices and associates them with |
+// Profiles. Listens for the Profile's destruction notification and cleans up |
+// the associated ArcBridgeService. |
+class ArcBridgeServiceFactory : public BrowserContextKeyedServiceFactory { |
+ public: |
+ static ArcBridgeService* GetForBrowserContext( |
+ content::BrowserContext *context); |
+ |
+ static ArcBridgeServiceFactory* GetInstance(); |
+ |
+ private: |
+ friend struct base::DefaultSingletonTraits<ArcBridgeServiceFactory>; |
+ |
+ ArcBridgeServiceFactory(); |
+ ~ArcBridgeServiceFactory() override; |
+ |
+ // BrowserContextKeyedServiceFactory: |
+ KeyedService* BuildServiceInstanceFor( |
+ content::BrowserContext* profile) const override; |
+ bool ServiceIsCreatedWithBrowserContext() const override; |
+}; |
+ |
+} // namespace arc |
+ |
+#endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_FACTORY_H_ |