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

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

Issue 22870011: chrome.mdns API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: can listen Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
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 // TODO(justinlin): Instead my NsdRegistry the LazyInstance.
13 // TODO(justinlin): Just need somehow to access profile to dispatch events.
14
15 namespace extensions {
16
17 // static
18 MDnsAPI* MDnsAPIFactory::GetForProfile(Profile* profile) {
mark a. foltz 2013/08/23 23:27:23 I wonder if profile can be const Profile* in these
19 return static_cast<MDnsAPI*>(
20 GetInstance()->GetServiceForBrowserContext(profile, true));
21 }
22
23 // static
24 MDnsAPIFactory* MDnsAPIFactory::GetInstance() {
25 return Singleton<MDnsAPIFactory>::get();
26 }
27
28 MDnsAPIFactory::MDnsAPIFactory() : BrowserContextKeyedServiceFactory(
29 "MDnsAPI", BrowserContextDependencyManager::GetInstance()) {
30 DependsOn(ExtensionSystemFactory::GetInstance());
31 }
32
33 MDnsAPIFactory::~MDnsAPIFactory() {
34 }
35
36 BrowserContextKeyedService *MDnsAPIFactory::BuildServiceInstanceFor(
37 content::BrowserContext* profile) const {
38 return new MDnsAPI(static_cast<Profile*>(profile));
39 }
40
41 bool MDnsAPIFactory::ServiceIsCreatedWithBrowserContext() const {
42 return true;
43 }
44
45 bool MDnsAPIFactory::ServiceIsNULLWhileTesting() const {
46 return true;
47 }
48
49 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698