Chromium Code Reviews| Index: chromeos/network/shill_property_util.h |
| diff --git a/chromeos/network/shill_property_util.h b/chromeos/network/shill_property_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..13d16a86f93f93eb8223cf03f43198ce8df8fa01 |
| --- /dev/null |
| +++ b/chromeos/network/shill_property_util.h |
| @@ -0,0 +1,54 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ |
| +#define CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/memory/scoped_ptr.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +class Value; |
| +} |
| + |
| +namespace chromeos { |
| + |
| +class NetworkUIData; |
| + |
| +namespace shill_property_util { |
| + |
| +// Generates a name from properties."Wifi.HexSSID" if present, otherwise |
| +// validates properties.Name and returns a valid utf8 version. |
| +std::string GetNameFromProperties(const std::string& service_path, |
| + const base::DictionaryValue& properties); |
| + |
| +// Returns the UIData specified by |value|. Returns NULL if the value cannot be |
| +// parsed. |
| +scoped_ptr<NetworkUIData> GetUIDataFromValue(const base::Value& value); |
| + |
| +// Returns the NetworkUIData parsed from the UIData property of |
| +// |shill_dictionary|. If parsing fails or the field doesn't exist, returns |
| +// NULL. |
| +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.
|
| + const base::DictionaryValue& shill_dictionary); |
| + |
| +// Sets the UIData property in |shill_dictionary| to the serialization of |
| +// |ui_data|. |
| +void SetUIData(const NetworkUIData& ui_data, |
| + base::DictionaryValue* shill_dictionary); |
| + |
| +// Copy configuration properties required by Shill to identify a network. |
| +// Only WiFi, VPN, Ethernet and EthernetEAP are supported. WiMax and Cellular |
| +// are not supported. Returns true only if all required properties could be |
| +// copied. |
| +bool CopyIdentifyingProperties(const base::DictionaryValue& service_properties, |
| + base::DictionaryValue* dest); |
| + |
| +} // namespace shill_property_util |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ |