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

Side by Side Diff: chrome/browser/extensions/api/mdns/mdns_api.h

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 #ifndef CHROME_BROWSER_EXTENSIONS_API_MDNS_MDNS_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MDNS_MDNS_API_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/extensions/api/api_function.h"
11 #include "chrome/browser/extensions/api/mdns/nsd_registry.h"
12 #include "chrome/browser/extensions/event_router.h"
13 #include "components/browser_context_keyed_service/browser_context_keyed_service .h"
14
15 namespace extensions {
16
17 class MDnsAPI : public BrowserContextKeyedService,
18 public EventRouter::Observer,
19 public NsdRegistry::Observer {
20 public:
21 explicit MDnsAPI(Profile* profile);
22
23 // An NSD registry for general local discovery.
24 NsdRegistry* nsd_registry();
25
26 virtual void OnNsdEvent(const NsdRegistry::NsdDeviceList& devices) OVERRIDE;
27 virtual void OnNsdEvent(NsdRegistry::NsdErrorCode type) OVERRIDE;
28
29 private:
30 virtual ~MDnsAPI();
31
32 // EventRouter::Observer:
33 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE;
34 virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE;
35
36 Profile* profile_;
mark a. foltz 2013/08/23 23:27:23 Profile *const profile_;
justinlin 2013/08/27 00:09:25 Done.
37
38 scoped_ptr<NsdRegistry> nsd_registry_;
39
40 DISALLOW_COPY_AND_ASSIGN(MDnsAPI);
41 };
42
43 } // namespace extensions
44
45 #endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_MDNS_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698