Chromium Code Reviews| 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_ |