1 // Copyright 2013 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 CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_SERVICE_CLIENT_FACTORY_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_SERVICE_CLIENT_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 extensions { 14 15 class NetworkingPrivateServiceClient; 16 17 class NetworkingPrivateServiceClientFactory 18 : public BrowserContextKeyedServiceFactory { 19 public: 20 static NetworkingPrivateServiceClient* GetForProfile(Profile* profile); 21 22 static NetworkingPrivateServiceClientFactory* GetInstance(); 23 24 private: 25 friend struct DefaultSingletonTraits<NetworkingPrivateServiceClientFactory>; 26 27 NetworkingPrivateServiceClientFactory(); 28 virtual ~NetworkingPrivateServiceClientFactory(); 29 30 // BrowserContextKeyedServiceFactory: 31 virtual KeyedService* BuildServiceInstanceFor( 32 content::BrowserContext* profile) const OVERRIDE; 33 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; 34 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; 35 36 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateServiceClientFactory); 37 }; 38 39 } // namespace extensions 40 41 #endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_SERVICE_CLIENT_FACTORY_H_ 42