Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/browser/extensions/api/mdns/mdns_api_factory.cc

Issue 23437015: Initial chrome.mdns API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698