This source file includes following definitions.
- GetForProfile
- GetInstance
- NetworkingPrivateServiceClientFactory
- BuildServiceInstanceFor
- ServiceIsCreatedWithBrowserContext
- ServiceIsNULLWhileTesting
#include "chrome/browser/extensions/api/networking_private/networking_private_service_client_factory.h"
#include "chrome/browser/extensions/api/networking_private/networking_private_service_client.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_system_provider.h"
#include "extensions/browser/extensions_browser_client.h"
namespace extensions {
NetworkingPrivateServiceClient*
NetworkingPrivateServiceClientFactory::GetForProfile(Profile* profile) {
return static_cast<NetworkingPrivateServiceClient*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
NetworkingPrivateServiceClientFactory*
NetworkingPrivateServiceClientFactory::GetInstance() {
return Singleton<NetworkingPrivateServiceClientFactory>::get();
}
NetworkingPrivateServiceClientFactory::NetworkingPrivateServiceClientFactory()
: BrowserContextKeyedServiceFactory(
"NetworkingPrivateServiceClient",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
}
NetworkingPrivateServiceClientFactory
::~NetworkingPrivateServiceClientFactory() {
}
KeyedService* NetworkingPrivateServiceClientFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
return new NetworkingPrivateServiceClient(
wifi::WiFiService::Create(),
NetworkingPrivateServiceClient::CryptoVerify::Create());
}
bool NetworkingPrivateServiceClientFactory::ServiceIsCreatedWithBrowserContext()
const {
return false;
}
bool NetworkingPrivateServiceClientFactory::ServiceIsNULLWhileTesting() const {
return false;
}
}