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..952e73d00610ec61e5b4b662017f03b1a9794b61 |
--- /dev/null |
+++ b/components/arc/arc_bridge_service_factory.h |
@@ -0,0 +1,43 @@ |
+// 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. |
+ |
+#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; |
oshima
2015/11/02 19:13:49
DISALLOW_COPY_AND_ASSIGN
Luis Héctor Chávez
2015/11/04 17:49:19
Done.
|
+}; |
+ |
+} // namespace arc |
+ |
+#endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_FACTORY_H_ |