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

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

Issue 22870011: chrome.mdns API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: can listen 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "chrome/browser/extensions/api/mdns/mdns_service.h"
12
13 namespace extensions {
14
15 // Network Service Discovery registry class for keeping track of local network
16 // services discovered on the local network.
17 class NsdRegistry {
18 public:
19 // TODO:
20 typedef std::vector<std::string> NsdDeviceList;
21
22 enum NsdErrorCode {
23 NSD_SERVICE_ERROR,
24 NSD_ERROR
25 };
26
27 class Observer {
28 public:
29 virtual void OnNsdEvent(const NsdDeviceList& devices) = 0;
30 virtual void OnNsdEvent(NsdErrorCode type) = 0;
31
32 protected:
33 virtual ~Observer() {}
34 };
35
36 MDnsService *mdns_service();
37
38 explicit NsdRegistry(Observer* mdns_api);
39 NsdRegistry();
40 ~NsdRegistry();
41
42 void RegisterMDnsListener(std::string serviceName);
mark a. foltz 2013/08/23 23:27:23 Where to we track which extension(s) are watching
justinlin 2013/08/27 00:09:25 There's now a map in MDnsApi
43
44 protected:
45
46 private:
47 scoped_ptr<MDnsService> mdns_service_;
48 };
49
50 } // namespace extensions
51
52 #endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698