OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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 #include "chrome/browser/extensions/api/mdns/mdns_api_factory.h" |
| 6 |
| 7 #include "chrome/browser/extensions/api/mdns/mdns_api.h" |
| 8 #include "chrome/browser/extensions/extension_system_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 11 |
| 12 namespace extensions { |
| 13 |
| 14 // static |
| 15 MDnsAPI* MDnsAPIFactory::GetForProfile(Profile* profile) { |
| 16 return static_cast<MDnsAPI*>( |
| 17 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 18 } |
| 19 |
| 20 // static |
| 21 MDnsAPIFactory* MDnsAPIFactory::GetInstance() { |
| 22 return Singleton<MDnsAPIFactory>::get(); |
| 23 } |
| 24 |
| 25 MDnsAPIFactory::MDnsAPIFactory() : BrowserContextKeyedServiceFactory( |
| 26 "MDnsAPI", BrowserContextDependencyManager::GetInstance()) { |
| 27 DependsOn(ExtensionSystemFactory::GetInstance()); |
| 28 } |
| 29 |
| 30 MDnsAPIFactory::~MDnsAPIFactory() { |
| 31 } |
| 32 |
| 33 BrowserContextKeyedService *MDnsAPIFactory::BuildServiceInstanceFor( |
| 34 content::BrowserContext* profile) const { |
| 35 return new MDnsAPI(static_cast<Profile*>(profile)); |
| 36 } |
| 37 |
| 38 bool MDnsAPIFactory::ServiceIsCreatedWithBrowserContext() const { |
| 39 return true; |
| 40 } |
| 41 |
| 42 bool MDnsAPIFactory::ServiceIsNULLWhileTesting() const { |
| 43 return true; |
| 44 } |
| 45 |
| 46 } // namespace extensions |
OLD | NEW |