OLD | NEW |
(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 class Observer { |
| 23 public: |
| 24 // virtual void OnNsdEvent(const NsdDeviceList& devices) = 0; |
| 25 virtual void OnMDnsEvent(const std::string& service_type, |
| 26 const NsdDeviceList& devices) = 0; |
| 27 |
| 28 protected: |
| 29 virtual ~Observer() {} |
| 30 }; |
| 31 |
| 32 MDnsService *mdns_service(); |
| 33 |
| 34 explicit NsdRegistry(Observer* observer); |
| 35 ~NsdRegistry(); |
| 36 |
| 37 void RegisterMDnsListener(std::string serviceName); |
| 38 void UnregisterMDnsListener(std::string serviceName); |
| 39 |
| 40 protected: |
| 41 |
| 42 private: |
| 43 scoped_ptr<MDnsService> mdns_service_; |
| 44 }; |
| 45 |
| 46 } // namespace extensions |
| 47 |
| 48 #endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ |
OLD | NEW |