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..8aacdb496a063e887d5ab45a64b66214407c0c5e |
--- /dev/null |
+++ b/chrome/browser/extensions/api/mdns/nsd_registry.h |
@@ -0,0 +1,48 @@ |
+// 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; |
+ |
+ class Observer { |
+ public: |
+ // virtual void OnNsdEvent(const NsdDeviceList& devices) = 0; |
+ virtual void OnMDnsEvent(const std::string& service_type, |
+ const NsdDeviceList& devices) = 0; |
+ |
+ protected: |
+ virtual ~Observer() {} |
+ }; |
+ |
+ MDnsService *mdns_service(); |
+ |
+ explicit NsdRegistry(Observer* observer); |
+ ~NsdRegistry(); |
+ |
+ void RegisterMDnsListener(std::string serviceName); |
+ void UnregisterMDnsListener(std::string serviceName); |
+ |
+ protected: |
+ |
+ private: |
+ scoped_ptr<MDnsService> mdns_service_; |
+}; |
+ |
+} // namespace extensions |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ |