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

Unified Diff: chromeos/arc/bridge/arc_bridge_service_factory.h

Issue 1412863004: arc-bridge: Add the ARC Bridge Service (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Created 5 years, 2 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: chromeos/arc/bridge/arc_bridge_service_factory.h
diff --git a/chromeos/arc/bridge/arc_bridge_service_factory.h b/chromeos/arc/bridge/arc_bridge_service_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb7775e421f64f9a00e69cd594b94ca89a5e263a
--- /dev/null
+++ b/chromeos/arc/bridge/arc_bridge_service_factory.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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 CHROMEOS_ARC_BRIDGE_ARC_BRIDGE_SERVICE_FACTORY_H_
+#define CHROMEOS_ARC_BRIDGE_ARC_BRIDGE_SERVICE_FACTORY_H_
+
+#include "base/memory/singleton.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+class Profile;
+
+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 {
oshima 2015/10/23 20:29:45 Does this have to be BrowserContext? can't you jus
Luis Héctor Chávez 2015/10/27 00:37:48 Changed the ArcBridgeService into a KeyedService.
+ public:
+ static ArcBridgeService* GetForProfile(Profile* profile);
+
+ 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 // CHROMEOS_ARC_BRIDGE_ARC_BRIDGE_SERVICE_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698