OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_DEVICE_DESCRIPTION_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_DEVICE_DESCRIPTION_H_ |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_DEVICE_DESCRIPTION_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_DEVICE_DESCRIPTION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "net/base/host_port_pair.h" | 11 #include "net/base/host_port_pair.h" |
12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
13 | 13 |
14 namespace local_discovery { | 14 namespace local_discovery { |
15 | 15 |
16 struct ServiceDescription; | 16 struct ServiceDescription; |
17 | 17 |
18 struct DeviceDescription { | 18 struct DeviceDescription { |
19 enum ConnectionState { | |
20 ONLINE, | |
21 OFFLINE, | |
22 CONNECTING, | |
23 NOT_CONFIGURED, | |
24 UNKNOWN | |
25 }; | |
26 | |
27 DeviceDescription(); | 19 DeviceDescription(); |
| 20 explicit DeviceDescription(const ServiceDescription& service_description); |
28 ~DeviceDescription(); | 21 ~DeviceDescription(); |
29 | 22 |
30 void FillFromServiceDescription( | 23 bool IsValid() const; |
31 const ServiceDescription& service_description); | |
32 | 24 |
33 // Display attributes | 25 // Display attributes |
34 std::string name; | 26 std::string name; |
35 std::string description; | 27 std::string description; |
36 | 28 |
37 // Functional attributes | 29 // Functional attributes |
38 std::string url; | |
39 std::string id; | 30 std::string id; |
40 std::string type; | 31 std::string type; |
41 int version; | 32 int version; |
42 ConnectionState connection_state; | |
43 | 33 |
44 // Attributes related to local HTTP | 34 // Attributes related to local HTTP |
45 net::HostPortPair address; | 35 net::HostPortPair address; |
46 net::IPAddressNumber ip_address; | |
47 base::Time last_seen; | |
48 }; | 36 }; |
49 | 37 |
50 } // namespace local_discovery | 38 } // namespace local_discovery |
51 | 39 |
52 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_DEVICE_DESCRIPTION_H_ | 40 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_DEVICE_DESCRIPTION_H_ |
OLD | NEW |