Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMEOS_ARC_BRIDGE_ARC_BRIDGE_SERVICE_FACTORY_H_ | |
| 6 #define CHROMEOS_ARC_BRIDGE_ARC_BRIDGE_SERVICE_FACTORY_H_ | |
| 7 | |
| 8 #include "base/memory/singleton.h" | |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | |
| 10 | |
| 11 class Profile; | |
| 12 | |
| 13 namespace arc { | |
| 14 | |
| 15 class ArcBridgeService; | |
| 16 | |
| 17 // Singleton that owns all ArcBridgeServices and associates them with | |
| 18 // Profiles. Listens for the Profile's destruction notification and cleans up | |
| 19 // the associated ArcBridgeService. | |
| 20 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.
| |
| 21 public: | |
| 22 static ArcBridgeService* GetForProfile(Profile* profile); | |
| 23 | |
| 24 static ArcBridgeServiceFactory* GetInstance(); | |
| 25 | |
| 26 private: | |
| 27 friend struct base::DefaultSingletonTraits<ArcBridgeServiceFactory>; | |
| 28 | |
| 29 ArcBridgeServiceFactory(); | |
| 30 ~ArcBridgeServiceFactory() override; | |
| 31 | |
| 32 // BrowserContextKeyedServiceFactory: | |
| 33 KeyedService* BuildServiceInstanceFor( | |
| 34 content::BrowserContext* profile) const override; | |
| 35 bool ServiceIsCreatedWithBrowserContext() const override; | |
| 36 }; | |
| 37 | |
| 38 } // namespace arc | |
| 39 | |
| 40 #endif // CHROMEOS_ARC_BRIDGE_ARC_BRIDGE_SERVICE_FACTORY_H_ | |
| OLD | NEW |