OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 COMPONENTS_ARC_ARC_BRIDGE_SERVICE_FACTORY_H_ |
| 6 #define COMPONENTS_ARC_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 namespace content { |
| 12 class BrowserContext; |
| 13 } |
| 14 |
| 15 namespace arc { |
| 16 |
| 17 class ArcBridgeService; |
| 18 |
| 19 // Singleton that owns all ArcBridgeServices and associates them with |
| 20 // Profiles. Listens for the Profile's destruction notification and cleans up |
| 21 // the associated ArcBridgeService. |
| 22 class ArcBridgeServiceFactory : public BrowserContextKeyedServiceFactory { |
| 23 public: |
| 24 static ArcBridgeService* GetForBrowserContext( |
| 25 content::BrowserContext *context); |
| 26 |
| 27 static ArcBridgeServiceFactory* GetInstance(); |
| 28 |
| 29 private: |
| 30 friend struct base::DefaultSingletonTraits<ArcBridgeServiceFactory>; |
| 31 |
| 32 ArcBridgeServiceFactory(); |
| 33 ~ArcBridgeServiceFactory() override; |
| 34 |
| 35 // BrowserContextKeyedServiceFactory: |
| 36 KeyedService* BuildServiceInstanceFor( |
| 37 content::BrowserContext* profile) const override; |
| 38 bool ServiceIsCreatedWithBrowserContext() const override; |
| 39 }; |
| 40 |
| 41 } // namespace arc |
| 42 |
| 43 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_FACTORY_H_ |
OLD | NEW |