1 // Copyright 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.
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_LISTER_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_LISTER_H_
10 #include "base/callback.h"
11 #include "base/time/time.h"
12 #include "net/base/host_port_pair.h"
13 #include "net/base/net_util.h"
15 namespace local_discovery {
17 struct DeviceDescription {
18 enum ConnectionState {
31 std::string description;
33 // Functional attributes
37 ConnectionState connection_state;
39 // Attributes related to local HTTP
40 net::HostPortPair address;
41 net::IPAddressNumber ip_address;
45 class PrivetDeviceLister {
49 virtual void DeviceChanged(bool added,
50 const std::string& name,
51 const DeviceDescription& description) = 0;
52 virtual void DeviceRemoved(const std::string& name) = 0;
53 virtual void DeviceCacheFlushed() = 0;
57 virtual ~PrivetDeviceLister() {}
59 // Start the PrivetServiceLister.
60 virtual void Start() = 0;
62 virtual void DiscoverNewDevices(bool force_update) = 0;
65 } // namespace local_discovery
67 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_LISTER_H_