| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" | 5 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/captive_portal/captive_portal_service.h" | 7 #include "chrome/browser/captive_portal/captive_portal_service.h" |
| 8 #include "chrome/browser/profiles/incognito_helpers.h" | 8 #include "chrome/browser/profiles/incognito_helpers.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 10 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 11 | 11 |
| 12 namespace captive_portal { | 12 namespace captive_portal { |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 CaptivePortalService* CaptivePortalServiceFactory::GetForProfile( | 15 CaptivePortalService* CaptivePortalServiceFactory::GetForProfile( |
| 16 Profile* profile) { | 16 Profile* profile) { |
| 17 return static_cast<CaptivePortalService*>( | 17 return static_cast<CaptivePortalService*>( |
| 18 GetInstance()->GetServiceForProfile(profile, true)); | 18 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 CaptivePortalServiceFactory* CaptivePortalServiceFactory::GetInstance() { | 22 CaptivePortalServiceFactory* CaptivePortalServiceFactory::GetInstance() { |
| 23 return Singleton<CaptivePortalServiceFactory>::get(); | 23 return Singleton<CaptivePortalServiceFactory>::get(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 CaptivePortalServiceFactory::CaptivePortalServiceFactory() | 26 CaptivePortalServiceFactory::CaptivePortalServiceFactory() |
| 27 : ProfileKeyedServiceFactory("CaptivePortalService", | 27 : BrowserContextKeyedServiceFactory("CaptivePortalService", |
| 28 ProfileDependencyManager::GetInstance()) { | 28 BrowserContextDependencyManager::GetInstance())
{ |
| 29 } | 29 } |
| 30 | 30 |
| 31 CaptivePortalServiceFactory::~CaptivePortalServiceFactory() { | 31 CaptivePortalServiceFactory::~CaptivePortalServiceFactory() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 ProfileKeyedService* CaptivePortalServiceFactory::BuildServiceInstanceFor( | 34 BrowserContextKeyedService* CaptivePortalServiceFactory::BuildServiceInstanceFor
( |
| 35 content::BrowserContext* profile) const { | 35 content::BrowserContext* profile) const { |
| 36 return new CaptivePortalService(static_cast<Profile*>(profile)); | 36 return new CaptivePortalService(static_cast<Profile*>(profile)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 content::BrowserContext* CaptivePortalServiceFactory::GetBrowserContextToUse( | 39 content::BrowserContext* CaptivePortalServiceFactory::GetBrowserContextToUse( |
| 40 content::BrowserContext* context) const { | 40 content::BrowserContext* context) const { |
| 41 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 41 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace captive_portal | 44 } // namespace captive_portal |
| OLD | NEW |