summaryrefslogtreecommitdiffstats
path: root/chromeos/network/shill_property_util.cc
diff options
context:
space:
mode:
authorbenchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-24 07:24:56 +0000
committerbenchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-24 07:24:56 +0000
commit547396c5c0ca818ca4ee7a4eb9667669a0898e73 (patch)
treecf5f5d591e4f2482f44532451f1fdfde50601f67 /chromeos/network/shill_property_util.cc
parent8b44fa5704850a6e891fd25aaaac34b616729df2 (diff)
downloadchromium_src-547396c5c0ca818ca4ee7a4eb9667669a0898e73.zip
chromium_src-547396c5c0ca818ca4ee7a4eb9667669a0898e73.tar.gz
chromium_src-547396c5c0ca818ca4ee7a4eb9667669a0898e73.tar.bz2
Migrate DBus service constants from flimflam namespace to shill namespace.
All shill DBus service constants have been moved from the flimflam namespace to the shill namespace. This CL makes the corresponding changes on the Chrome side. Related CLs: https://chromium-review.googlesource.com/#/c/170123/ https://chromium-review.googlesource.com/#/c/170205/ https://chromium-review.googlesource.com/#/c/170206/ https://chromium-review.googlesource.com/#/c/170207/ https://chromium-review.googlesource.com/#/c/170208/ https://chromium-review.googlesource.com/#/c/170209/ https://chromium-review.googlesource.com/#/c/170223/ https://chromium-review.googlesource.com/#/c/170230/ https://chromium-review.googlesource.com/#/c/170231/ BUG=295425 R=gspencer@chromium.org,gauravsh@chromium.org,stevenjb@chromium.org Review URL: https://chromiumcodereview.appspot.com/24348002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/network/shill_property_util.cc')
-rw-r--r--chromeos/network/shill_property_util.cc52
1 files changed, 25 insertions, 27 deletions
diff --git a/chromeos/network/shill_property_util.cc b/chromeos/network/shill_property_util.cc
index c97c152..0f736d8 100644
--- a/chromeos/network/shill_property_util.cc
+++ b/chromeos/network/shill_property_util.cc
@@ -61,8 +61,8 @@ bool CopyStringFromDictionary(const base::DictionaryValue& source,
std::string GetNameFromProperties(const std::string& service_path,
const base::DictionaryValue& properties) {
std::string name, hex_ssid;
- properties.GetStringWithoutPathExpansion(flimflam::kNameProperty, &name);
- properties.GetStringWithoutPathExpansion(flimflam::kWifiHexSsid, &hex_ssid);
+ properties.GetStringWithoutPathExpansion(shill::kNameProperty, &name);
+ properties.GetStringWithoutPathExpansion(shill::kWifiHexSsid, &hex_ssid);
if (hex_ssid.empty()) {
if (name.empty())
@@ -106,7 +106,7 @@ std::string GetNameFromProperties(const std::string& service_path,
// Detect encoding and convert to UTF-8.
std::string country_code;
- properties.GetStringWithoutPathExpansion(flimflam::kCountryProperty,
+ properties.GetStringWithoutPathExpansion(shill::kCountryProperty,
&country_code);
std::string encoding;
if (!base::DetectEncoding(ssid, &encoding)) {
@@ -156,7 +156,7 @@ scoped_ptr<NetworkUIData> GetUIDataFromValue(const base::Value& ui_data_value) {
scoped_ptr<NetworkUIData> GetUIDataFromProperties(
const base::DictionaryValue& shill_dictionary) {
const base::Value* ui_data_value = NULL;
- shill_dictionary.GetWithoutPathExpansion(flimflam::kUIDataProperty,
+ shill_dictionary.GetWithoutPathExpansion(shill::kUIDataProperty,
&ui_data_value);
if (!ui_data_value) {
VLOG(2) << "Dictionary has no UIData entry.";
@@ -174,7 +174,7 @@ void SetUIData(const NetworkUIData& ui_data,
ui_data.FillDictionary(&ui_data_dict);
std::string ui_data_blob;
base::JSONWriter::Write(&ui_data_dict, &ui_data_blob);
- shill_dictionary->SetStringWithoutPathExpansion(flimflam::kUIDataProperty,
+ shill_dictionary->SetStringWithoutPathExpansion(shill::kUIDataProperty,
ui_data_blob);
}
@@ -183,46 +183,44 @@ bool CopyIdentifyingProperties(const base::DictionaryValue& service_properties,
bool success = true;
// GUID is optional.
- CopyStringFromDictionary(service_properties, flimflam::kGuidProperty, dest);
+ CopyStringFromDictionary(service_properties, shill::kGuidProperty, dest);
std::string type;
- service_properties.GetStringWithoutPathExpansion(flimflam::kTypeProperty,
- &type);
+ service_properties.GetStringWithoutPathExpansion(shill::kTypeProperty, &type);
success &= !type.empty();
- dest->SetStringWithoutPathExpansion(flimflam::kTypeProperty, type);
- if (type == flimflam::kTypeWifi) {
+ dest->SetStringWithoutPathExpansion(shill::kTypeProperty, type);
+ if (type == shill::kTypeWifi) {
success &= CopyStringFromDictionary(
- service_properties, flimflam::kSecurityProperty, dest);
+ service_properties, shill::kSecurityProperty, dest);
success &= CopyStringFromDictionary(
- service_properties, flimflam::kSSIDProperty, dest);
+ service_properties, shill::kSSIDProperty, dest);
success &= CopyStringFromDictionary(
- service_properties, flimflam::kModeProperty, dest);
- } else if (type == flimflam::kTypeVPN) {
+ service_properties, shill::kModeProperty, dest);
+ } else if (type == shill::kTypeVPN) {
success &= CopyStringFromDictionary(
- service_properties, flimflam::kNameProperty, dest);
+ service_properties, shill::kNameProperty, dest);
// VPN Provider values are read from the "Provider" dictionary, but written
// with the keys "Provider.Type" and "Provider.Host".
const base::DictionaryValue* provider_properties = NULL;
if (!service_properties.GetDictionaryWithoutPathExpansion(
- flimflam::kProviderProperty, &provider_properties)) {
+ shill::kProviderProperty, &provider_properties)) {
NET_LOG_ERROR("CopyIdentifyingProperties", "Missing VPN provider dict");
return false;
}
std::string vpn_provider_type;
- provider_properties->GetStringWithoutPathExpansion(flimflam::kTypeProperty,
+ provider_properties->GetStringWithoutPathExpansion(shill::kTypeProperty,
&vpn_provider_type);
success &= !vpn_provider_type.empty();
- dest->SetStringWithoutPathExpansion(flimflam::kProviderTypeProperty,
+ dest->SetStringWithoutPathExpansion(shill::kProviderTypeProperty,
vpn_provider_type);
std::string vpn_provider_host;
- provider_properties->GetStringWithoutPathExpansion(flimflam::kHostProperty,
+ provider_properties->GetStringWithoutPathExpansion(shill::kHostProperty,
&vpn_provider_host);
success &= !vpn_provider_host.empty();
- dest->SetStringWithoutPathExpansion(flimflam::kProviderHostProperty,
+ dest->SetStringWithoutPathExpansion(shill::kProviderHostProperty,
vpn_provider_host);
- } else if (type == flimflam::kTypeEthernet ||
- type == shill::kTypeEthernetEap) {
+ } else if (type == shill::kTypeEthernet || type == shill::kTypeEthernetEap) {
// Ethernet and EthernetEAP don't have any additional identifying
// properties.
} else {
@@ -258,12 +256,12 @@ struct ShillToBitFlagEntry {
const char* shill_network_type;
NetworkTypeBitFlag bit_flag;
} shill_type_to_flag[] = {
- { flimflam::kTypeEthernet, kNetworkTypeEthernet },
+ { shill::kTypeEthernet, kNetworkTypeEthernet },
{ shill::kTypeEthernetEap, kNetworkTypeEthernetEap },
- { flimflam::kTypeWifi, kNetworkTypeWifi },
- { flimflam::kTypeWimax, kNetworkTypeWimax },
- { flimflam::kTypeCellular, kNetworkTypeCellular },
- { flimflam::kTypeVPN, kNetworkTypeVPN }
+ { shill::kTypeWifi, kNetworkTypeWifi },
+ { shill::kTypeWimax, kNetworkTypeWimax },
+ { shill::kTypeCellular, kNetworkTypeCellular },
+ { shill::kTypeVPN, kNetworkTypeVPN }
};
NetworkTypeBitFlag ShillNetworkTypeToFlag(const std::string& shill_type) {