| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_FACTORY_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_FACTORY_H_ |
| 6 #define EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_FACTORY_H_ | 6 #define EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 class BrowserContext; | 13 class BrowserContext; |
| 14 | 14 |
| 15 } // namespace content | 15 } // namespace content |
| 16 | 16 |
| 17 namespace base { |
| 17 template <typename T> | 18 template <typename T> |
| 18 struct DefaultSingletonTraits; | 19 struct DefaultSingletonTraits; |
| 20 } |
| 19 | 21 |
| 20 namespace chromeos { | 22 namespace chromeos { |
| 21 | 23 |
| 22 class VpnService; | 24 class VpnService; |
| 23 | 25 |
| 24 // Factory to create VpnService. | 26 // Factory to create VpnService. |
| 25 class VpnServiceFactory : public BrowserContextKeyedServiceFactory { | 27 class VpnServiceFactory : public BrowserContextKeyedServiceFactory { |
| 26 public: | 28 public: |
| 27 static VpnService* GetForBrowserContext(content::BrowserContext* context); | 29 static VpnService* GetForBrowserContext(content::BrowserContext* context); |
| 28 static VpnServiceFactory* GetInstance(); | 30 static VpnServiceFactory* GetInstance(); |
| 29 | 31 |
| 30 private: | 32 private: |
| 31 friend struct DefaultSingletonTraits<VpnServiceFactory>; | 33 friend struct base::DefaultSingletonTraits<VpnServiceFactory>; |
| 32 | 34 |
| 33 VpnServiceFactory(); | 35 VpnServiceFactory(); |
| 34 ~VpnServiceFactory() override; | 36 ~VpnServiceFactory() override; |
| 35 | 37 |
| 36 // BrowserContextKeyedServiceFactory: | 38 // BrowserContextKeyedServiceFactory: |
| 37 bool ServiceIsCreatedWithBrowserContext() const override; | 39 bool ServiceIsCreatedWithBrowserContext() const override; |
| 38 bool ServiceIsNULLWhileTesting() const override; | 40 bool ServiceIsNULLWhileTesting() const override; |
| 39 KeyedService* BuildServiceInstanceFor( | 41 KeyedService* BuildServiceInstanceFor( |
| 40 content::BrowserContext* context) const override; | 42 content::BrowserContext* context) const override; |
| 41 | 43 |
| 42 DISALLOW_COPY_AND_ASSIGN(VpnServiceFactory); | 44 DISALLOW_COPY_AND_ASSIGN(VpnServiceFactory); |
| 43 }; | 45 }; |
| 44 | 46 |
| 45 } // namespace chromeos | 47 } // namespace chromeos |
| 46 | 48 |
| 47 #endif // EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_FACTORY_H_ | 49 #endif // EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_FACTORY_H_ |
| OLD | NEW |