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