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 #include "chromeos/chromeos_export.h" |
| 12 |
| 13 namespace base { |
| 14 class DictionaryValue; |
| 15 class Value; |
| 16 } |
| 17 |
| 18 namespace chromeos { |
| 19 |
| 20 class NetworkUIData; |
| 21 |
| 22 namespace shill_property_util { |
| 23 |
| 24 // Generates a name from properties."Wifi.HexSSID" if present, otherwise |
| 25 // validates properties.Name and returns a valid utf8 version. |
| 26 CHROMEOS_EXPORT std::string GetNameFromProperties( |
| 27 const std::string& service_path, |
| 28 const base::DictionaryValue& properties); |
| 29 |
| 30 // Returns the UIData specified by |value|. Returns NULL if the value cannot be |
| 31 // parsed. |
| 32 scoped_ptr<NetworkUIData> GetUIDataFromValue(const base::Value& value); |
| 33 |
| 34 // Returns the NetworkUIData parsed from the UIData property of |
| 35 // |shill_dictionary|. If parsing fails or the field doesn't exist, returns |
| 36 // NULL. |
| 37 scoped_ptr<NetworkUIData> GetUIDataFromProperties( |
| 38 const base::DictionaryValue& shill_dictionary); |
| 39 |
| 40 // Sets the UIData property in |shill_dictionary| to the serialization of |
| 41 // |ui_data|. |
| 42 void SetUIData(const NetworkUIData& ui_data, |
| 43 base::DictionaryValue* shill_dictionary); |
| 44 |
| 45 // Copy configuration properties required by Shill to identify a network. |
| 46 // Only WiFi, VPN, Ethernet and EthernetEAP are supported. WiMax and Cellular |
| 47 // are not supported. Returns true only if all required properties could be |
| 48 // copied. |
| 49 bool CopyIdentifyingProperties(const base::DictionaryValue& service_properties, |
| 50 base::DictionaryValue* dest); |
| 51 |
| 52 } // namespace shill_property_util |
| 53 |
| 54 } // namespace chromeos |
| 55 |
| 56 #endif // CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ |
OLD | NEW |