OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ | |
6 #define CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/memory/scoped_ptr.h" | |
11 | |
12 namespace base { | |
13 class DictionaryValue; | |
14 class Value; | |
15 } | |
16 | |
17 namespace chromeos { | |
18 | |
19 class NetworkUIData; | |
20 | |
21 namespace shill_property_util { | |
22 | |
23 // Generates a name from properties."Wifi.HexSSID" if present, otherwise | |
24 // validates properties.Name and returns a valid utf8 version. | |
25 std::string GetNameFromProperties(const std::string& service_path, | |
26 const base::DictionaryValue& properties); | |
27 | |
28 // Returns the UIData specified by |value|. Returns NULL if the value cannot be | |
29 // parsed. | |
30 scoped_ptr<NetworkUIData> GetUIDataFromValue(const base::Value& value); | |
31 | |
32 // Returns the NetworkUIData parsed from the UIData property of | |
33 // |shill_dictionary|. If parsing fails or the field doesn't exist, returns | |
34 // NULL. | |
35 scoped_ptr<NetworkUIData> GetUIDataFromShillDictionary( | |
stevenjb
2013/09/03 15:54:53
nit: We use [GetName]FromProperties above and From
pneubeck (no reviews)
2013/09/04 09:19:02
Right. In this case i think the namespace "shill_p
stevenjb
2013/09/04 18:00:29
Good point.
| |
36 const base::DictionaryValue& shill_dictionary); | |
37 | |
38 // Sets the UIData property in |shill_dictionary| to the serialization of | |
39 // |ui_data|. | |
40 void SetUIData(const NetworkUIData& ui_data, | |
41 base::DictionaryValue* shill_dictionary); | |
42 | |
43 // Copy configuration properties required by Shill to identify a network. | |
44 // Only WiFi, VPN, Ethernet and EthernetEAP are supported. WiMax and Cellular | |
45 // are not supported. Returns true only if all required properties could be | |
46 // copied. | |
47 bool CopyIdentifyingProperties(const base::DictionaryValue& service_properties, | |
48 base::DictionaryValue* dest); | |
49 | |
50 } // namespace shill_property_util | |
51 | |
52 } // namespace chromeos | |
53 | |
54 #endif // CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ | |
OLD | NEW |