Index: chrome/browser/extensions/api/mdns/nsd_registry.h |
diff --git a/chrome/browser/extensions/api/mdns/nsd_registry.h b/chrome/browser/extensions/api/mdns/nsd_registry.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9bbf303214a8efeeaf97cdb24ee639d1ec78dea2 |
--- /dev/null |
+++ b/chrome/browser/extensions/api/mdns/nsd_registry.h |
@@ -0,0 +1,52 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ |
+#define CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "chrome/browser/extensions/api/mdns/mdns_service.h" |
+ |
+namespace extensions { |
+ |
+// Network Service Discovery registry class for keeping track of local network |
+// services discovered on the local network. |
+class NsdRegistry { |
+ public: |
+ // TODO: |
+ typedef std::vector<std::string> NsdDeviceList; |
+ |
+ enum NsdErrorCode { |
+ NSD_SERVICE_ERROR, |
+ NSD_ERROR |
+ }; |
+ |
+ class Observer { |
+ public: |
+ virtual void OnNsdEvent(const NsdDeviceList& devices) = 0; |
+ virtual void OnNsdEvent(NsdErrorCode type) = 0; |
+ |
+ protected: |
+ virtual ~Observer() {} |
+ }; |
+ |
+ MDnsService *mdns_service(); |
+ |
+ explicit NsdRegistry(Observer* mdns_api); |
+ NsdRegistry(); |
+ ~NsdRegistry(); |
+ |
+ 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
|
+ |
+ protected: |
+ |
+ private: |
+ scoped_ptr<MDnsService> mdns_service_; |
+}; |
+ |
+} // namespace extensions |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ |