1 // Copyright (c) 2012 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.
5 #include "chrome/browser/captive_portal/captive_portal_service_factory.h"
7 #include "chrome/browser/captive_portal/captive_portal_service.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_dependency_manager.h"
11 namespace captive_portal
{
14 CaptivePortalService
* CaptivePortalServiceFactory::GetForProfile(
16 return static_cast<CaptivePortalService
*>(
17 GetInstance()->GetServiceForProfile(profile
, true));
21 CaptivePortalServiceFactory
* CaptivePortalServiceFactory::GetInstance() {
22 return Singleton
<CaptivePortalServiceFactory
>::get();
25 CaptivePortalServiceFactory::CaptivePortalServiceFactory()
26 : ProfileKeyedServiceFactory("CaptivePortalService",
27 ProfileDependencyManager::GetInstance()) {
30 CaptivePortalServiceFactory::~CaptivePortalServiceFactory() {
33 ProfileKeyedService
* CaptivePortalServiceFactory::BuildServiceInstanceFor(
34 Profile
* profile
) const {
35 return new CaptivePortalService(profile
);
38 bool CaptivePortalServiceFactory::ServiceHasOwnInstanceInIncognito() const {
42 } // namespace captive_portal