diff options
author | benchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-24 07:24:56 +0000 |
---|---|---|
committer | benchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-24 07:24:56 +0000 |
commit | 547396c5c0ca818ca4ee7a4eb9667669a0898e73 (patch) | |
tree | cf5f5d591e4f2482f44532451f1fdfde50601f67 | |
parent | 8b44fa5704850a6e891fd25aaaac34b616729df2 (diff) | |
download | chromium_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
41 files changed, 554 insertions, 580 deletions
diff --git a/chromeos/network/client_cert_resolver_unittest.cc b/chromeos/network/client_cert_resolver_unittest.cc index f275c82..b802bf3 100644 --- a/chromeos/network/client_cert_resolver_unittest.cc +++ b/chromeos/network/client_cert_resolver_unittest.cc @@ -145,12 +145,12 @@ class ClientCertResolverTest : public testing::Test { const bool add_to_watchlist = true; service_test_->AddService(kWifiStub, kWifiSSID, - flimflam::kTypeWifi, - flimflam::kStateOnline, + shill::kTypeWifi, + shill::kStateOnline, add_to_visible, add_to_watchlist); service_test_->SetServiceProperty( - kWifiStub, flimflam::kGuidProperty, base::StringValue(kWifiStub)); + kWifiStub, shill::kGuidProperty, base::StringValue(kWifiStub)); profile_test_->AddService(kUserProfilePath, kWifiStub); } @@ -196,7 +196,7 @@ class ClientCertResolverTest : public testing::Test { service_test_->GetServiceProperties(kWifiStub); if (!properties) return; - properties->GetStringWithoutPathExpansion(flimflam::kEapCertIdProperty, + properties->GetStringWithoutPathExpansion(shill::kEapCertIdProperty, pkcs11_id); } diff --git a/chromeos/network/client_cert_util.cc b/chromeos/network/client_cert_util.cc index 88ff649..a1ec8a4 100644 --- a/chromeos/network/client_cert_util.cc +++ b/chromeos/network/client_cert_util.cc @@ -208,33 +208,33 @@ void SetShillProperties(const client_cert::ConfigType cert_config_type, return; } case CONFIG_TYPE_OPENVPN: { - tpm_pin_property = flimflam::kOpenVPNPinProperty; + tpm_pin_property = shill::kOpenVPNPinProperty; if (pkcs11_id) { properties->SetStringWithoutPathExpansion( - flimflam::kOpenVPNClientCertIdProperty, *pkcs11_id); + shill::kOpenVPNClientCertIdProperty, *pkcs11_id); } break; } case CONFIG_TYPE_IPSEC: { - tpm_pin_property = flimflam::kL2tpIpsecPinProperty; + tpm_pin_property = shill::kL2tpIpsecPinProperty; if (!tpm_slot.empty()) { properties->SetStringWithoutPathExpansion( - flimflam::kL2tpIpsecClientCertSlotProperty, tpm_slot); + shill::kL2tpIpsecClientCertSlotProperty, tpm_slot); } if (pkcs11_id) { properties->SetStringWithoutPathExpansion( - flimflam::kL2tpIpsecClientCertIdProperty, *pkcs11_id); + shill::kL2tpIpsecClientCertIdProperty, *pkcs11_id); } break; } case CONFIG_TYPE_EAP: { - tpm_pin_property = flimflam::kEapPinProperty; + tpm_pin_property = shill::kEapPinProperty; if (pkcs11_id) { // Shill requires both CertID and KeyID for TLS connections, despite the // fact that by convention they are the same ID. - properties->SetStringWithoutPathExpansion(flimflam::kEapCertIdProperty, + properties->SetStringWithoutPathExpansion(shill::kEapCertIdProperty, *pkcs11_id); - properties->SetStringWithoutPathExpansion(flimflam::kEapKeyIdProperty, + properties->SetStringWithoutPathExpansion(shill::kEapKeyIdProperty, *pkcs11_id); } break; @@ -250,7 +250,7 @@ bool IsCertificateConfigured(const client_cert::ConfigType cert_config_type, // VPN certificate properties are read from the Provider dictionary. const base::DictionaryValue* provider_properties = NULL; service_properties.GetDictionaryWithoutPathExpansion( - flimflam::kProviderProperty, &provider_properties); + shill::kProviderProperty, &provider_properties); switch (cert_config_type) { case CONFIG_TYPE_NONE: return true; @@ -263,11 +263,11 @@ bool IsCertificateConfigured(const client_cert::ConfigType cert_config_type, return false; case CONFIG_TYPE_EAP: { std::string cert_id = GetStringFromDictionary( - service_properties, flimflam::kEapCertIdProperty); + service_properties, shill::kEapCertIdProperty); std::string key_id = GetStringFromDictionary( - service_properties, flimflam::kEapKeyIdProperty); + service_properties, shill::kEapKeyIdProperty); std::string identity = GetStringFromDictionary( - service_properties, flimflam::kEapIdentityProperty); + service_properties, shill::kEapIdentityProperty); return !cert_id.empty() && !key_id.empty() && !identity.empty(); } } diff --git a/chromeos/network/device_state.cc b/chromeos/network/device_state.cc index f71b978..d39fc14 100644 --- a/chromeos/network/device_state.cc +++ b/chromeos/network/device_state.cc @@ -31,23 +31,23 @@ bool DeviceState::PropertyChanged(const std::string& key, if (ManagedStatePropertyChanged(key, value)) return true; - if (key == flimflam::kAddressProperty) { + if (key == shill::kAddressProperty) { return GetStringValue(key, value, &mac_address_); - } else if (key == flimflam::kScanningProperty) { + } else if (key == shill::kScanningProperty) { return GetBooleanValue(key, value, &scanning_); - } else if (key == flimflam::kSupportNetworkScanProperty) { + } else if (key == shill::kSupportNetworkScanProperty) { return GetBooleanValue(key, value, &support_network_scan_); } else if (key == shill::kProviderRequiresRoamingProperty) { return GetBooleanValue(key, value, &provider_requires_roaming_); - } else if (key == flimflam::kHomeProviderProperty) { + } else if (key == shill::kHomeProviderProperty) { const base::DictionaryValue* dict = NULL; if (!value.GetAsDictionary(&dict)) return false; std::string home_provider_country; std::string home_provider_name; - dict->GetStringWithoutPathExpansion(flimflam::kOperatorCountryKey, + dict->GetStringWithoutPathExpansion(shill::kOperatorCountryKey, &home_provider_country); - dict->GetStringWithoutPathExpansion(flimflam::kOperatorNameKey, + dict->GetStringWithoutPathExpansion(shill::kOperatorNameKey, &home_provider_name); // Set home_provider_id_ if (!home_provider_name.empty() && !home_provider_country.empty()) { @@ -56,17 +56,17 @@ bool DeviceState::PropertyChanged(const std::string& key, home_provider_name.c_str(), home_provider_country.c_str()); } else { - dict->GetStringWithoutPathExpansion(flimflam::kOperatorCodeKey, + dict->GetStringWithoutPathExpansion(shill::kOperatorCodeKey, &home_provider_id_); LOG(WARNING) << "Carrier ID not defined, using code instead: " << home_provider_id_; } return true; - } else if (key == flimflam::kTechnologyFamilyProperty) { + } else if (key == shill::kTechnologyFamilyProperty) { return GetStringValue(key, value, &technology_family_); - } else if (key == flimflam::kCarrierProperty) { + } else if (key == shill::kCarrierProperty) { return GetStringValue(key, value, &carrier_); - } else if (key == flimflam::kFoundNetworksProperty) { + } else if (key == shill::kFoundNetworksProperty) { const base::ListValue* list = NULL; if (!value.GetAsList(&list)) return false; @@ -75,7 +75,7 @@ bool DeviceState::PropertyChanged(const std::string& key, return false; scan_results_.swap(parsed_results); return true; - } else if (key == flimflam::kSIMLockStatusProperty) { + } else if (key == shill::kSIMLockStatusProperty) { const base::DictionaryValue* dict = NULL; if (!value.GetAsDictionary(&dict)) return false; @@ -83,35 +83,35 @@ bool DeviceState::PropertyChanged(const std::string& key, // Return true if at least one of the property values changed. bool property_changed = false; const base::Value* out_value = NULL; - if (!dict->GetWithoutPathExpansion(flimflam::kSIMLockRetriesLeftProperty, + if (!dict->GetWithoutPathExpansion(shill::kSIMLockRetriesLeftProperty, &out_value)) return false; - if (GetUInt32Value(flimflam::kSIMLockRetriesLeftProperty, + if (GetUInt32Value(shill::kSIMLockRetriesLeftProperty, *out_value, &sim_retries_left_)) property_changed = true; - if (!dict->GetWithoutPathExpansion(flimflam::kSIMLockTypeProperty, + if (!dict->GetWithoutPathExpansion(shill::kSIMLockTypeProperty, &out_value)) return false; - if (GetStringValue(flimflam::kSIMLockTypeProperty, + if (GetStringValue(shill::kSIMLockTypeProperty, *out_value, &sim_lock_type_)) property_changed = true; - if (!dict->GetWithoutPathExpansion(flimflam::kSIMLockEnabledProperty, + if (!dict->GetWithoutPathExpansion(shill::kSIMLockEnabledProperty, &out_value)) return false; - if (GetBooleanValue(flimflam::kSIMLockEnabledProperty, + if (GetBooleanValue(shill::kSIMLockEnabledProperty, *out_value, &sim_lock_enabled_)) property_changed = true; return property_changed; - } else if (key == flimflam::kMeidProperty) { + } else if (key == shill::kMeidProperty) { return GetStringValue(key, value, &meid_); - } else if (key == flimflam::kImeiProperty) { + } else if (key == shill::kImeiProperty) { return GetStringValue(key, value, &imei_); - } else if (key == flimflam::kIccidProperty) { + } else if (key == shill::kIccidProperty) { return GetStringValue(key, value, &iccid_); - } else if (key == flimflam::kMdnProperty) { + } else if (key == shill::kMdnProperty) { return GetStringValue(key, value, &mdn_); } else if (key == shill::kSIMPresentProperty) { return GetBooleanValue(key, value, &sim_present_); @@ -130,7 +130,7 @@ bool DeviceState::InitialPropertiesReceived( } bool DeviceState::IsSimAbsent() const { - return technology_family_ == flimflam::kTechnologyFamilyGsm && !sim_present_; + return technology_family_ == shill::kTechnologyFamilyGsm && !sim_present_; } } // namespace chromeos diff --git a/chromeos/network/favorite_state.cc b/chromeos/network/favorite_state.cc index 96fc74f..66efe55 100644 --- a/chromeos/network/favorite_state.cc +++ b/chromeos/network/favorite_state.cc @@ -26,9 +26,9 @@ bool FavoriteState::PropertyChanged(const std::string& key, const base::Value& value) { if (ManagedStatePropertyChanged(key, value)) return true; - if (key == flimflam::kProfileProperty) { + if (key == shill::kProfileProperty) { return GetStringValue(key, value, &profile_path_); - } else if (key == flimflam::kUIDataProperty) { + } else if (key == shill::kUIDataProperty) { scoped_ptr<NetworkUIData> new_ui_data = shill_property_util::GetUIDataFromValue(value); if (!new_ui_data) { @@ -37,7 +37,7 @@ bool FavoriteState::PropertyChanged(const std::string& key, } ui_data_ = *new_ui_data; return true; - } else if (key == flimflam::kGuidProperty) { + } else if (key == shill::kGuidProperty) { return GetStringValue(key, value, &guid_); } return false; diff --git a/chromeos/network/geolocation_handler.cc b/chromeos/network/geolocation_handler.cc index 468b2d0..d4adfb8 100644 --- a/chromeos/network/geolocation_handler.cc +++ b/chromeos/network/geolocation_handler.cc @@ -64,13 +64,13 @@ void GeolocationHandler::ManagerPropertiesCallback( DBusMethodCallStatus call_status, const base::DictionaryValue& properties) { const base::Value* value = NULL; - if (properties.Get(flimflam::kEnabledTechnologiesProperty, &value) && value) - HandlePropertyChanged(flimflam::kEnabledTechnologiesProperty, *value); + if (properties.Get(shill::kEnabledTechnologiesProperty, &value) && value) + HandlePropertyChanged(shill::kEnabledTechnologiesProperty, *value); } void GeolocationHandler::HandlePropertyChanged(const std::string& key, const base::Value& value) { - if (key != flimflam::kEnabledTechnologiesProperty) + if (key != shill::kEnabledTechnologiesProperty) return; const base::ListValue* technologies = NULL; if (!value.GetAsList(&technologies) || !technologies) @@ -81,7 +81,7 @@ void GeolocationHandler::HandlePropertyChanged(const std::string& key, iter != technologies->end(); ++iter) { std::string technology; (*iter)->GetAsString(&technology); - if (technology == flimflam::kTypeWifi) { + if (technology == shill::kTypeWifi) { wifi_enabled_ = true; break; } diff --git a/chromeos/network/geolocation_handler_unittest.cc b/chromeos/network/geolocation_handler_unittest.cc index 8657497..be0985d 100644 --- a/chromeos/network/geolocation_handler_unittest.cc +++ b/chromeos/network/geolocation_handler_unittest.cc @@ -57,7 +57,7 @@ class GeolocationHandlerTest : public testing::Test { shill::kGeoChannelProperty, channel); properties.SetStringWithoutPathExpansion( shill::kGeoSignalStrengthProperty, strength); - manager_test_->AddGeoNetwork(flimflam::kTypeWifi, properties); + manager_test_->AddGeoNetwork(shill::kTypeWifi, properties); message_loop_.RunUntilIdle(); } diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc index f48efe0..f6c8414 100644 --- a/chromeos/network/managed_network_configuration_handler_impl.cc +++ b/chromeos/network/managed_network_configuration_handler_impl.cc @@ -144,7 +144,7 @@ void ManagedNetworkConfigurationHandlerImpl::GetManagedPropertiesCallback( const std::string& service_path, const base::DictionaryValue& shill_properties) { std::string profile_path; - shill_properties.GetStringWithoutPathExpansion(flimflam::kProfileProperty, + shill_properties.GetStringWithoutPathExpansion(shill::kProfileProperty, &profile_path); const NetworkProfile* profile = network_profile_handler_->GetProfileForPath(profile_path); diff --git a/chromeos/network/managed_network_configuration_handler_unittest.cc b/chromeos/network/managed_network_configuration_handler_unittest.cc index dfeaebc..c2eca5e 100644 --- a/chromeos/network/managed_network_configuration_handler_unittest.cc +++ b/chromeos/network/managed_network_configuration_handler_unittest.cc @@ -79,7 +79,7 @@ class ShillProfileTestClient { ASSERT_TRUE(entries); base::DictionaryValue* new_entry = entry.DeepCopy(); - new_entry->SetStringWithoutPathExpansion(flimflam::kProfileProperty, + new_entry->SetStringWithoutPathExpansion(shill::kProfileProperty, profile_path); entries->SetWithoutPathExpansion(entry_path, new_entry); } @@ -94,8 +94,7 @@ class ShillProfileTestClient { scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue); base::ListValue* entry_paths = new base::ListValue; - result->SetWithoutPathExpansion(flimflam::kEntriesProperty, - entry_paths); + result->SetWithoutPathExpansion(shill::kEntriesProperty, entry_paths); for (base::DictionaryValue::Iterator it(*entries); !it.IsAtEnd(); it.Advance()) { entry_paths->AppendString(it.key()); @@ -412,7 +411,7 @@ TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyUpdateManagedNewGUID) { // The passphrase isn't sent again, because it's configured by the user and // Shill doesn't sent it on GetProperties calls. expected_shill_properties->RemoveWithoutPathExpansion( - flimflam::kPassphraseProperty, NULL); + shill::kPassphraseProperty, NULL); EXPECT_CALL(mock_profile_client_, GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _)); @@ -448,7 +447,7 @@ TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyReapplyToManaged) { // The passphrase isn't sent again, because it's configured by the user and // Shill doesn't sent it on GetProperties calls. expected_shill_properties->RemoveWithoutPathExpansion( - flimflam::kPassphraseProperty, NULL); + shill::kPassphraseProperty, NULL); EXPECT_CALL(mock_profile_client_, GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _)); diff --git a/chromeos/network/managed_state.cc b/chromeos/network/managed_state.cc index cedddf3..b4f77fb 100644 --- a/chromeos/network/managed_state.cc +++ b/chromeos/network/managed_state.cc @@ -66,9 +66,9 @@ bool ManagedState::InitialPropertiesReceived( bool ManagedState::ManagedStatePropertyChanged(const std::string& key, const base::Value& value) { - if (key == flimflam::kNameProperty) { + if (key == shill::kNameProperty) { return GetStringValue(key, value, &name_); - } else if (key == flimflam::kTypeProperty) { + } else if (key == shill::kTypeProperty) { return GetStringValue(key, value, &type_); } return false; diff --git a/chromeos/network/managed_state.h b/chromeos/network/managed_state.h index 7f9875e..2cab509 100644 --- a/chromeos/network/managed_state.h +++ b/chromeos/network/managed_state.h @@ -110,8 +110,8 @@ class CHROMEOS_EXPORT ManagedState { std::string path_; // Common properties shared by all managed state objects. - std::string name_; // flimflam::kNameProperty - std::string type_; // flimflam::kTypeProperty + std::string name_; // shill::kNameProperty + std::string type_; // shill::kTypeProperty // Set to true when the an update has been received. bool update_received_; diff --git a/chromeos/network/network_cert_migrator.cc b/chromeos/network/network_cert_migrator.cc index 259f2a9..f32dc16 100644 --- a/chromeos/network/network_cert_migrator.cc +++ b/chromeos/network/network_cert_migrator.cc @@ -131,11 +131,11 @@ class NetworkCertMigrator::MigrationTask const char* pem_key; UMANetworkType uma_type; } const kNssPemMap[] = { - { NULL, flimflam::kEapCaCertNssProperty, shill::kEapCaCertPemProperty, + { NULL, shill::kEapCaCertNssProperty, shill::kEapCaCertPemProperty, UMA_NETWORK_TYPE_EAP }, - { flimflam::kProviderProperty, flimflam::kL2tpIpsecCaCertNssProperty, + { shill::kProviderProperty, shill::kL2tpIpsecCaCertNssProperty, shill::kL2tpIpsecCaCertPemProperty, UMA_NETWORK_TYPE_IPSEC }, - { flimflam::kProviderProperty, flimflam::kOpenVPNCaCertNSSProperty, + { shill::kProviderProperty, shill::kOpenVPNCaCertNSSProperty, shill::kOpenVPNCaCertPemProperty, UMA_NETWORK_TYPE_OPENVPN }, }; diff --git a/chromeos/network/network_cert_migrator_unittest.cc b/chromeos/network/network_cert_migrator_unittest.cc index ee2dcdf..f1f5fb2 100644 --- a/chromeos/network/network_cert_migrator_unittest.cc +++ b/chromeos/network/network_cert_migrator_unittest.cc @@ -104,12 +104,12 @@ class NetworkCertMigratorTest : public testing::Test { const bool add_to_watchlist = true; service_test_->AddService(kWifiStub, kWifiStub, - flimflam::kTypeWifi, - flimflam::kStateOnline, + shill::kTypeWifi, + shill::kStateOnline, add_to_visible, add_to_watchlist); service_test_->SetServiceProperty(kWifiStub, - flimflam::kEapCaCertNssProperty, + shill::kEapCaCertNssProperty, base::StringValue(kNSSNickname)); } @@ -118,7 +118,7 @@ class NetworkCertMigratorTest : public testing::Test { ca_pem->clear(); const base::DictionaryValue* properties = service_test_->GetServiceProperties(kWifiStub); - properties->GetStringWithoutPathExpansion(flimflam::kEapCaCertNssProperty, + properties->GetStringWithoutPathExpansion(shill::kEapCaCertNssProperty, nss_nickname); const base::ListValue* ca_pems = NULL; properties->GetListWithoutPathExpansion(shill::kEapCaCertPemProperty, @@ -132,16 +132,16 @@ class NetworkCertMigratorTest : public testing::Test { const bool add_to_watchlist = true; service_test_->AddService(kVPNStub, kVPNStub, - flimflam::kTypeVPN, - flimflam::kStateIdle, + shill::kTypeVPN, + shill::kStateIdle, add_to_visible, add_to_watchlist); base::DictionaryValue provider; - const char* nss_property = open_vpn ? flimflam::kOpenVPNCaCertNSSProperty - : flimflam::kL2tpIpsecCaCertNssProperty; + const char* nss_property = open_vpn ? shill::kOpenVPNCaCertNSSProperty + : shill::kL2tpIpsecCaCertNssProperty; provider.SetStringWithoutPathExpansion(nss_property, kNSSNickname); service_test_->SetServiceProperty( - kVPNStub, flimflam::kProviderProperty, provider); + kVPNStub, shill::kProviderProperty, provider); } void GetVpnCACertProperties(bool open_vpn, @@ -152,12 +152,12 @@ class NetworkCertMigratorTest : public testing::Test { const base::DictionaryValue* properties = service_test_->GetServiceProperties(kVPNStub); const base::DictionaryValue* provider = NULL; - properties->GetDictionaryWithoutPathExpansion(flimflam::kProviderProperty, + properties->GetDictionaryWithoutPathExpansion(shill::kProviderProperty, &provider); if (!provider) return; - const char* nss_property = open_vpn ? flimflam::kOpenVPNCaCertNSSProperty - : flimflam::kL2tpIpsecCaCertNssProperty; + const char* nss_property = open_vpn ? shill::kOpenVPNCaCertNSSProperty + : shill::kL2tpIpsecCaCertNssProperty; provider->GetStringWithoutPathExpansion(nss_property, nss_nickname); const base::ListValue* ca_pems = NULL; const char* pem_property = open_vpn ? shill::kOpenVPNCaCertPemProperty diff --git a/chromeos/network/network_change_notifier_chromeos.cc b/chromeos/network/network_change_notifier_chromeos.cc index dd95cf6..d8d3d2c 100644 --- a/chromeos/network/network_change_notifier_chromeos.cc +++ b/chromeos/network/network_change_notifier_chromeos.cc @@ -199,23 +199,23 @@ NetworkChangeNotifierChromeos::ConnectionTypeFromShill( const std::string& type, const std::string& technology) { if (NetworkTypePattern::Ethernet().MatchesType(type)) return CONNECTION_ETHERNET; - else if (type == flimflam::kTypeWifi) + else if (type == shill::kTypeWifi) return CONNECTION_WIFI; - else if (type == flimflam::kTypeWimax) + else if (type == shill::kTypeWimax) return CONNECTION_4G; - if (type != flimflam::kTypeCellular) + if (type != shill::kTypeCellular) return CONNECTION_UNKNOWN; // For cellular types, mapping depends on the technology. - if (technology == flimflam::kNetworkTechnologyEvdo || - technology == flimflam::kNetworkTechnologyGsm || - technology == flimflam::kNetworkTechnologyUmts || - technology == flimflam::kNetworkTechnologyHspa) { + if (technology == shill::kNetworkTechnologyEvdo || + technology == shill::kNetworkTechnologyGsm || + technology == shill::kNetworkTechnologyUmts || + technology == shill::kNetworkTechnologyHspa) { return CONNECTION_3G; - } else if (technology == flimflam::kNetworkTechnologyHspaPlus || - technology == flimflam::kNetworkTechnologyLte || - technology == flimflam::kNetworkTechnologyLteAdvanced) { + } else if (technology == shill::kNetworkTechnologyHspaPlus || + technology == shill::kNetworkTechnologyLte || + technology == shill::kNetworkTechnologyLteAdvanced) { return CONNECTION_4G; } else { return CONNECTION_2G; // Default cellular type is 2G. diff --git a/chromeos/network/network_change_notifier_chromeos_unittest.cc b/chromeos/network/network_change_notifier_chromeos_unittest.cc index f8462d8..90e5162 100644 --- a/chromeos/network/network_change_notifier_chromeos_unittest.cc +++ b/chromeos/network/network_change_notifier_chromeos_unittest.cc @@ -63,32 +63,32 @@ TEST(NetworkChangeNotifierChromeosTest, ConnectionTypeFromShill) { NetworkChangeNotifier::ConnectionType connection_type; }; TypeMapping type_mappings[] = { - { flimflam::kTypeEthernet, "", NetworkChangeNotifier::CONNECTION_ETHERNET }, - { flimflam::kTypeWifi, "", NetworkChangeNotifier::CONNECTION_WIFI }, - { flimflam::kTypeWimax, "", NetworkChangeNotifier::CONNECTION_4G }, + { shill::kTypeEthernet, "", NetworkChangeNotifier::CONNECTION_ETHERNET }, + { shill::kTypeWifi, "", NetworkChangeNotifier::CONNECTION_WIFI }, + { shill::kTypeWimax, "", NetworkChangeNotifier::CONNECTION_4G }, { "unknown type", "unknown technology", NetworkChangeNotifier::CONNECTION_UNKNOWN }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnology1Xrtt, + { shill::kTypeCellular, shill::kNetworkTechnology1Xrtt, NetworkChangeNotifier::CONNECTION_2G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyGprs, + { shill::kTypeCellular, shill::kNetworkTechnologyGprs, NetworkChangeNotifier::CONNECTION_2G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyEdge, + { shill::kTypeCellular, shill::kNetworkTechnologyEdge, NetworkChangeNotifier::CONNECTION_2G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyEvdo, + { shill::kTypeCellular, shill::kNetworkTechnologyEvdo, NetworkChangeNotifier::CONNECTION_3G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyGsm, + { shill::kTypeCellular, shill::kNetworkTechnologyGsm, NetworkChangeNotifier::CONNECTION_3G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyUmts, + { shill::kTypeCellular, shill::kNetworkTechnologyUmts, NetworkChangeNotifier::CONNECTION_3G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyHspa, + { shill::kTypeCellular, shill::kNetworkTechnologyHspa, NetworkChangeNotifier::CONNECTION_3G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyHspaPlus, + { shill::kTypeCellular, shill::kNetworkTechnologyHspaPlus, NetworkChangeNotifier::CONNECTION_4G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyLte, + { shill::kTypeCellular, shill::kNetworkTechnologyLte, NetworkChangeNotifier::CONNECTION_4G }, - { flimflam::kTypeCellular, flimflam::kNetworkTechnologyLteAdvanced, + { shill::kTypeCellular, shill::kNetworkTechnologyLteAdvanced, NetworkChangeNotifier::CONNECTION_4G }, - { flimflam::kTypeCellular, "unknown technology", + { shill::kTypeCellular, "unknown technology", NetworkChangeNotifier::CONNECTION_2G } }; @@ -128,9 +128,9 @@ class NetworkChangeNotifierChromeosUpdateTest : public testing::Test { void SetDefaultNetworkState( const DefaultNetworkState& default_network_state) { if (default_network_state.is_connected) - default_network_.connection_state_ = flimflam::kStateOnline; + default_network_.connection_state_ = shill::kStateOnline; else - default_network_.connection_state_ = flimflam::kStateConfiguration; + default_network_.connection_state_ = shill::kStateConfiguration; default_network_.type_ = default_network_state.type; default_network_.network_technology_ = default_network_state.network_technology; @@ -158,20 +158,20 @@ NotifierUpdateTestCase test_cases[] = { { "Online -> Offline", { NetworkChangeNotifier::CONNECTION_ETHERNET, kService1, kIpAddress1, kDnsServers1 }, - { false, flimflam::kTypeEthernet, "", kService1, "", "" }, + { false, shill::kTypeEthernet, "", kService1, "", "" }, { NetworkChangeNotifier::CONNECTION_NONE, "", "", "" }, true, true, true }, { "Offline -> Offline", { NetworkChangeNotifier::CONNECTION_NONE, "", "", "" }, - { false, flimflam::kTypeEthernet, "", kService1, kIpAddress1, + { false, shill::kTypeEthernet, "", kService1, kIpAddress1, kDnsServers1 }, { NetworkChangeNotifier::CONNECTION_NONE, "", "", "" }, false, false, false }, { "Offline -> Online", { NetworkChangeNotifier::CONNECTION_NONE, "", "", "" }, - { true, flimflam::kTypeEthernet, "", kService1, kIpAddress1, kDnsServers1 }, + { true, shill::kTypeEthernet, "", kService1, kIpAddress1, kDnsServers1 }, { NetworkChangeNotifier::CONNECTION_ETHERNET, kService1, kIpAddress1, kDnsServers1 }, true, true, true @@ -179,7 +179,7 @@ NotifierUpdateTestCase test_cases[] = { { "Online -> Online (new default service, different connection type)", { NetworkChangeNotifier::CONNECTION_ETHERNET, kService1, kIpAddress1, kDnsServers1 }, - { true, flimflam::kTypeWifi, "", kService2, kIpAddress1, kDnsServers1 }, + { true, shill::kTypeWifi, "", kService2, kIpAddress1, kDnsServers1 }, { NetworkChangeNotifier::CONNECTION_WIFI, kService2, kIpAddress1, kDnsServers1 }, true, true, true @@ -187,14 +187,14 @@ NotifierUpdateTestCase test_cases[] = { { "Online -> Online (new default service, same connection type)", { NetworkChangeNotifier::CONNECTION_WIFI, kService2, kIpAddress1, kDnsServers1 }, - { true, flimflam::kTypeWifi, "", kService3, kIpAddress1, kDnsServers1 }, + { true, shill::kTypeWifi, "", kService3, kIpAddress1, kDnsServers1 }, { NetworkChangeNotifier::CONNECTION_WIFI, kService3, kIpAddress1, kDnsServers1 }, false, true, true }, { "Online -> Online (same default service, first IP address update)", { NetworkChangeNotifier::CONNECTION_WIFI, kService3, "", kDnsServers1 }, - { true, flimflam::kTypeWifi, "", kService3, kIpAddress2, kDnsServers1 }, + { true, shill::kTypeWifi, "", kService3, kIpAddress2, kDnsServers1 }, { NetworkChangeNotifier::CONNECTION_WIFI, kService3, kIpAddress2, kDnsServers1 }, false, false, false @@ -202,7 +202,7 @@ NotifierUpdateTestCase test_cases[] = { { "Online -> Online (same default service, new IP address, same DNS)", { NetworkChangeNotifier::CONNECTION_WIFI, kService3, kIpAddress1, kDnsServers1 }, - { true, flimflam::kTypeWifi, "", kService3, kIpAddress2, kDnsServers1 }, + { true, shill::kTypeWifi, "", kService3, kIpAddress2, kDnsServers1 }, { NetworkChangeNotifier::CONNECTION_WIFI, kService3, kIpAddress2, kDnsServers1 }, false, true, false @@ -210,7 +210,7 @@ NotifierUpdateTestCase test_cases[] = { { "Online -> Online (same default service, same IP address, new DNS)", { NetworkChangeNotifier::CONNECTION_WIFI, kService3, kIpAddress2, kDnsServers1 }, - { true, flimflam::kTypeWifi, "", kService3, kIpAddress2, kDnsServers2 }, + { true, shill::kTypeWifi, "", kService3, kIpAddress2, kDnsServers2 }, { NetworkChangeNotifier::CONNECTION_WIFI, kService3, kIpAddress2, kDnsServers2 }, false, false, true diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc index 7748623..f464dee 100644 --- a/chromeos/network/network_configuration_handler.cc +++ b/chromeos/network/network_configuration_handler.cc @@ -60,8 +60,7 @@ void GetPropertiesCallback( std::string name = shill_property_util::GetNameFromProperties(service_path, properties); if (!name.empty()) { - properties_copy->SetStringWithoutPathExpansion( - flimflam::kNameProperty, name); + properties_copy->SetStringWithoutPathExpansion(shill::kNameProperty, name); } if (call_status != DBUS_METHOD_CALL_SUCCESS) { // Because network services are added and removed frequently, we will see @@ -92,15 +91,15 @@ void SetNetworkProfileErrorCallback( } bool IsPassphrase(const std::string& key) { - return key == flimflam::kEapPrivateKeyPasswordProperty || - key == flimflam::kEapPasswordProperty || - key == flimflam::kL2tpIpsecPasswordProperty || - key == flimflam::kOpenVPNPasswordProperty || - key == flimflam::kPassphraseProperty || - key == flimflam::kOpenVPNOTPProperty || - key == flimflam::kEapPrivateKeyProperty || - key == flimflam::kEapPinProperty || - key == flimflam::kApnPasswordProperty; + return key == shill::kEapPrivateKeyPasswordProperty || + key == shill::kEapPasswordProperty || + key == shill::kL2tpIpsecPasswordProperty || + key == shill::kOpenVPNPasswordProperty || + key == shill::kPassphraseProperty || + key == shill::kOpenVPNOTPProperty || + key == shill::kEapPrivateKeyProperty || + key == shill::kEapPinProperty || + key == shill::kApnPasswordProperty; } void LogConfigProperties(const std::string& desc, @@ -285,13 +284,13 @@ void NetworkConfigurationHandler::CreateConfiguration( ShillManagerClient* manager = DBusThreadManager::Get()->GetShillManagerClient(); std::string type; - properties.GetStringWithoutPathExpansion(flimflam::kTypeProperty, &type); + properties.GetStringWithoutPathExpansion(shill::kTypeProperty, &type); NET_LOG_USER("CreateConfiguration", type); LogConfigProperties("Configure", type, properties); std::string profile; - properties.GetStringWithoutPathExpansion(flimflam::kProfileProperty, + properties.GetStringWithoutPathExpansion(shill::kProfileProperty, &profile); DCHECK(!profile.empty()); manager->ConfigureServiceForProfile( @@ -333,7 +332,7 @@ void NetworkConfigurationHandler::SetNetworkProfile( base::StringValue profile_path_value(profile_path); DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(service_path), - flimflam::kProfileProperty, + shill::kProfileProperty, profile_path_value, callback, base::Bind(&SetNetworkProfileErrorCallback, diff --git a/chromeos/network/network_configuration_handler_unittest.cc b/chromeos/network/network_configuration_handler_unittest.cc index b8b019c..e353543 100644 --- a/chromeos/network/network_configuration_handler_unittest.cc +++ b/chromeos/network/network_configuration_handler_unittest.cc @@ -1,4 +1,4 @@ - // Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -336,9 +336,9 @@ TEST_F(NetworkConfigurationHandlerTest, CreateConfiguration) { scoped_ptr<base::StringValue> networkNameValue( base::Value::CreateStringValue(networkName)); base::DictionaryValue value; - value.SetWithoutPathExpansion(flimflam::kSSIDProperty, + value.SetWithoutPathExpansion(shill::kSSIDProperty, base::Value::CreateStringValue(networkName)); - value.SetWithoutPathExpansion(flimflam::kProfileProperty, + value.SetWithoutPathExpansion(shill::kProfileProperty, base::Value::CreateStringValue(profile)); EXPECT_CALL(*mock_manager_client_, @@ -499,9 +499,9 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubSetAndClearProperties) { // Set Properties base::DictionaryValue properties_to_set; properties_to_set.SetStringWithoutPathExpansion( - flimflam::kIdentityProperty, test_identity); + shill::kIdentityProperty, test_identity); properties_to_set.SetStringWithoutPathExpansion( - flimflam::kPassphraseProperty, test_passphrase); + shill::kPassphraseProperty, test_passphrase); network_configuration_handler_->SetProperties( service_path, properties_to_set, @@ -514,17 +514,17 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubSetAndClearProperties) { EXPECT_EQ("SetProperties", success_callback_name_); std::string identity, passphrase; EXPECT_TRUE(GetServiceStringProperty( - service_path, flimflam::kIdentityProperty, &identity)); + service_path, shill::kIdentityProperty, &identity)); EXPECT_TRUE(GetServiceStringProperty( - service_path, flimflam::kPassphraseProperty, &passphrase)); + service_path, shill::kPassphraseProperty, &passphrase)); EXPECT_EQ(test_identity, identity); EXPECT_EQ(test_passphrase, passphrase); EXPECT_EQ(1, test_observer_->PropertyUpdatesForService(service_path)); // Clear Properties std::vector<std::string> properties_to_clear; - properties_to_clear.push_back(flimflam::kIdentityProperty); - properties_to_clear.push_back(flimflam::kPassphraseProperty); + properties_to_clear.push_back(shill::kIdentityProperty); + properties_to_clear.push_back(shill::kPassphraseProperty); network_configuration_handler_->ClearProperties( service_path, properties_to_clear, @@ -536,9 +536,9 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubSetAndClearProperties) { EXPECT_EQ("ClearProperties", success_callback_name_); EXPECT_FALSE(GetServiceStringProperty( - service_path, flimflam::kIdentityProperty, &identity)); + service_path, shill::kIdentityProperty, &identity)); EXPECT_FALSE(GetServiceStringProperty( - service_path, flimflam::kIdentityProperty, &passphrase)); + service_path, shill::kIdentityProperty, &passphrase)); EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(service_path)); } @@ -551,7 +551,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubGetNameFromWifiHex) { // Set Properties base::DictionaryValue properties_to_set; properties_to_set.SetStringWithoutPathExpansion( - flimflam::kWifiHexSsid, wifi_hex); + shill::kWifiHexSsid, wifi_hex); network_configuration_handler_->SetProperties( service_path, properties_to_set, @@ -560,7 +560,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubGetNameFromWifiHex) { message_loop_.RunUntilIdle(); std::string wifi_hex_result; EXPECT_TRUE(GetServiceStringProperty( - service_path, flimflam::kWifiHexSsid, &wifi_hex_result)); + service_path, shill::kWifiHexSsid, &wifi_hex_result)); EXPECT_EQ(wifi_hex, wifi_hex_result); // Get Properties @@ -574,25 +574,22 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubGetNameFromWifiHex) { EXPECT_EQ(service_path, get_properties_path_); std::string name_result; EXPECT_TRUE(GetReceivedStringProperty( - service_path, flimflam::kNameProperty, &name_result)); + service_path, shill::kNameProperty, &name_result)); EXPECT_EQ(expected_name, name_result); } TEST_F(NetworkConfigurationHandlerStubTest, StubCreateConfiguration) { const std::string service_path("test_wifi"); base::DictionaryValue properties; + properties.SetStringWithoutPathExpansion(shill::kSSIDProperty, service_path); + properties.SetStringWithoutPathExpansion(shill::kNameProperty, service_path); + properties.SetStringWithoutPathExpansion(shill::kGuidProperty, service_path); properties.SetStringWithoutPathExpansion( - flimflam::kSSIDProperty, service_path); + shill::kTypeProperty, shill::kTypeWifi); properties.SetStringWithoutPathExpansion( - flimflam::kNameProperty, service_path); + shill::kStateProperty, shill::kStateIdle); properties.SetStringWithoutPathExpansion( - flimflam::kGuidProperty, service_path); - properties.SetStringWithoutPathExpansion( - flimflam::kTypeProperty, flimflam::kTypeWifi); - properties.SetStringWithoutPathExpansion( - flimflam::kStateProperty, flimflam::kStateIdle); - properties.SetStringWithoutPathExpansion( - flimflam::kProfileProperty, shill_stub_helper::kSharedProfilePath); + shill::kProfileProperty, shill_stub_helper::kSharedProfilePath); network_configuration_handler_->CreateConfiguration( properties, @@ -606,12 +603,12 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubCreateConfiguration) { std::string ssid; EXPECT_TRUE(GetServiceStringProperty( - create_service_path_, flimflam::kSSIDProperty, &ssid)); + create_service_path_, shill::kSSIDProperty, &ssid)); std::string actual_profile; EXPECT_EQ(service_path, ssid); EXPECT_TRUE(GetServiceStringProperty( - create_service_path_, flimflam::kProfileProperty, &actual_profile)); + create_service_path_, shill::kProfileProperty, &actual_profile)); EXPECT_EQ(shill_stub_helper::kSharedProfilePath, actual_profile); } diff --git a/chromeos/network/network_connection_handler.cc b/chromeos/network/network_connection_handler.cc index 00776aa..e6889f0 100644 --- a/chromeos/network/network_connection_handler.cc +++ b/chromeos/network/network_connection_handler.cc @@ -40,8 +40,8 @@ void InvokeErrorCallback(const std::string& service_path, } bool IsAuthenticationError(const std::string& error) { - return (error == flimflam::kErrorBadWEPKey || - error == flimflam::kErrorPppAuthFailed || + return (error == shill::kErrorBadWEPKey || + error == shill::kErrorPppAuthFailed || error == shill::kErrorEapLocalTlsFailed || error == shill::kErrorEapRemoteTlsFailed || error == shill::kErrorEapAuthenticationFailed); @@ -50,24 +50,24 @@ bool IsAuthenticationError(const std::string& error) { bool VPNIsConfigured(const std::string& service_path, const std::string& provider_type, const base::DictionaryValue& provider_properties) { - if (provider_type == flimflam::kProviderOpenVpn) { + if (provider_type == shill::kProviderOpenVpn) { std::string hostname; provider_properties.GetStringWithoutPathExpansion( - flimflam::kHostProperty, &hostname); + shill::kHostProperty, &hostname); if (hostname.empty()) { NET_LOG_EVENT("OpenVPN: No hostname", service_path); return false; } std::string username; provider_properties.GetStringWithoutPathExpansion( - flimflam::kOpenVPNUserProperty, &username); + shill::kOpenVPNUserProperty, &username); if (username.empty()) { NET_LOG_EVENT("OpenVPN: No username", service_path); return false; } bool passphrase_required = false; provider_properties.GetBooleanWithoutPathExpansion( - flimflam::kPassphraseRequiredProperty, &passphrase_required); + shill::kPassphraseRequiredProperty, &passphrase_required); if (passphrase_required) { NET_LOG_EVENT("OpenVPN: Passphrase Required", service_path); return false; @@ -77,7 +77,7 @@ bool VPNIsConfigured(const std::string& service_path, bool passphrase_required = false; std::string passphrase; provider_properties.GetBooleanWithoutPathExpansion( - flimflam::kL2tpIpsecPskRequiredProperty, &passphrase_required); + shill::kL2tpIpsecPskRequiredProperty, &passphrase_required); if (passphrase_required) { NET_LOG_EVENT("VPN: PSK Required", service_path); return false; @@ -232,7 +232,7 @@ void NetworkConnectionHandler::ConnectToNetwork( if (check_error_state) { const std::string& error = network->error(); - if (error == flimflam::kErrorBadPassphrase) { + if (error == shill::kErrorBadPassphrase) { InvokeErrorCallback(service_path, error_callback, error); return; } @@ -251,8 +251,7 @@ void NetworkConnectionHandler::ConnectToNetwork( // Connect immediately to 'connectable' networks. // TODO(stevenjb): Shill needs to properly set Connectable for VPN. - if (network && - network->connectable() && network->type() != flimflam::kTypeVPN) { + if (network && network->connectable() && network->type() != shill::kTypeVPN) { CallShillConnect(service_path); return; } @@ -324,24 +323,23 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect( // has not been set to a minimum length value. bool passphrase_required = false; service_properties.GetBooleanWithoutPathExpansion( - flimflam::kPassphraseRequiredProperty, &passphrase_required); + shill::kPassphraseRequiredProperty, &passphrase_required); if (passphrase_required) { ErrorCallbackForPendingRequest(service_path, kErrorPassphraseRequired); return; } std::string type, security; + service_properties.GetStringWithoutPathExpansion(shill::kTypeProperty, &type); service_properties.GetStringWithoutPathExpansion( - flimflam::kTypeProperty, &type); - service_properties.GetStringWithoutPathExpansion( - flimflam::kSecurityProperty, &security); + shill::kSecurityProperty, &security); bool connectable = false; service_properties.GetBooleanWithoutPathExpansion( - flimflam::kConnectableProperty, &connectable); + shill::kConnectableProperty, &connectable); // In case NetworkState was not available in ConnectToNetwork (e.g. it had // been recently configured), we need to check Connectable again. - if (connectable && type != flimflam::kTypeVPN) { + if (connectable && type != shill::kTypeVPN) { // TODO(stevenjb): Shill needs to properly set Connectable for VPN. CallShillConnect(service_path); return; @@ -350,16 +348,16 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect( // Get VPN provider type and host (required for configuration) and ensure // that required VPN non-cert properties are set. std::string vpn_provider_type, vpn_provider_host; - if (type == flimflam::kTypeVPN) { + if (type == shill::kTypeVPN) { // VPN Provider values are read from the "Provider" dictionary, not the // "Provider.Type", etc keys (which are used only to set the values). const base::DictionaryValue* provider_properties; if (service_properties.GetDictionaryWithoutPathExpansion( - flimflam::kProviderProperty, &provider_properties)) { + shill::kProviderProperty, &provider_properties)) { provider_properties->GetStringWithoutPathExpansion( - flimflam::kTypeProperty, &vpn_provider_type); + shill::kTypeProperty, &vpn_provider_type); provider_properties->GetStringWithoutPathExpansion( - flimflam::kHostProperty, &vpn_provider_host); + shill::kHostProperty, &vpn_provider_host); } if (vpn_provider_type.empty() || vpn_provider_host.empty()) { ErrorCallbackForPendingRequest(service_path, kErrorConfigurationRequired); @@ -375,13 +373,12 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect( } client_cert::ConfigType client_cert_type = client_cert::CONFIG_TYPE_NONE; - if (type == flimflam::kTypeVPN) { - if (vpn_provider_type == flimflam::kProviderOpenVpn) + if (type == shill::kTypeVPN) { + if (vpn_provider_type == shill::kProviderOpenVpn) client_cert_type = client_cert::CONFIG_TYPE_OPENVPN; else client_cert_type = client_cert::CONFIG_TYPE_IPSEC; - } else if (type == flimflam::kTypeWifi && - security == flimflam::kSecurity8021x) { + } else if (type == shill::kTypeWifi && security == shill::kSecurity8021x) { client_cert_type = client_cert::CONFIG_TYPE_EAP; } @@ -525,7 +522,7 @@ void NetworkConnectionHandler::HandleShillConnectFailure( network_handler::ErrorCallback error_callback = request->error_callback; pending_requests_.erase(service_path); network_handler::ShillErrorCallbackFunction( - flimflam::kErrorConnectFailed, service_path, error_callback, + shill::kErrorConnectFailed, service_path, error_callback, dbus_error_name, dbus_error_message); } @@ -551,7 +548,7 @@ void NetworkConnectionHandler::CheckPendingRequest( pending_requests_.erase(service_path); return; } - if (network->connection_state() == flimflam::kStateIdle && + if (network->connection_state() == shill::kStateIdle && request->connect_state != ConnectRequest::CONNECT_CONNECTING) { // Connection hasn't started yet, keep waiting. return; @@ -559,17 +556,17 @@ void NetworkConnectionHandler::CheckPendingRequest( // Network is neither connecting or connected; an error occurred. std::string error_name, error_detail; - if (network->connection_state() == flimflam::kStateIdle && + if (network->connection_state() == shill::kStateIdle && pending_requests_.size() > 1) { // Another connect request canceled this one. error_name = kErrorConnectCanceled; error_detail = ""; } else { - error_name = flimflam::kErrorConnectFailed; + error_name = shill::kErrorConnectFailed; error_detail = network->error(); if (error_detail.empty()) { - if (network->connection_state() == flimflam::kStateFailure) - error_detail = flimflam::kUnknownString; + if (network->connection_state() == shill::kStateFailure) + error_detail = shill::kUnknownString; else error_detail = "Unexpected State: " + network->connection_state(); } diff --git a/chromeos/network/network_connection_handler.h b/chromeos/network/network_connection_handler.h index d67a41c..2bc40c4 100644 --- a/chromeos/network/network_connection_handler.h +++ b/chromeos/network/network_connection_handler.h @@ -91,8 +91,8 @@ class CHROMEOS_EXPORT NetworkConnectionHandler // ConnectToNetwork() will start an asynchronous connection attempt. // On success, |success_callback| will be called. // On failure, |error_callback| will be called with |error_name| one of the - // constants defined above, or flimflam::kErrorConnectFailed or - // flimflam::kErrorBadPassphrase if the Shill Error property (from a + // constants defined above, or shill::kErrorConnectFailed or + // shill::kErrorBadPassphrase if the Shill Error property (from a // previous connect attempt) was set to one of those. // |error_message| will contain an additional error string for debugging. // If |check_error_state| is true, the current state of the network is diff --git a/chromeos/network/network_connection_handler_unittest.cc b/chromeos/network/network_connection_handler_unittest.cc index 68c3a9b..0e991ef 100644 --- a/chromeos/network/network_connection_handler_unittest.cc +++ b/chromeos/network/network_connection_handler_unittest.cc @@ -160,8 +160,8 @@ TEST_F(NetworkConnectionHandlerTest, NetworkConnectionHandlerConnectSuccess) { EXPECT_TRUE(Configure(kConfigConnectable)); Connect("wifi0"); EXPECT_EQ(kSuccessResult, GetResultAndReset()); - EXPECT_EQ(flimflam::kStateOnline, - GetServiceStringProperty("wifi0", flimflam::kStateProperty)); + EXPECT_EQ(shill::kStateOnline, + GetServiceStringProperty("wifi0", shill::kStateProperty)); } // Handles basic failure cases. diff --git a/chromeos/network/network_device_handler.cc b/chromeos/network/network_device_handler.cc index c480073..ab456eb 100644 --- a/chromeos/network/network_device_handler.cc +++ b/chromeos/network/network_device_handler.cc @@ -33,11 +33,11 @@ std::string GetErrorNameForShillError(const std::string& shill_error_name) { return NetworkDeviceHandler::kErrorFailure; if (shill_error_name == kShillErrorNotSupported) return NetworkDeviceHandler::kErrorNotSupported; - if (shill_error_name == flimflam::kErrorIncorrectPinMsg) + if (shill_error_name == shill::kErrorIncorrectPinMsg) return NetworkDeviceHandler::kErrorIncorrectPin; - if (shill_error_name == flimflam::kErrorPinBlockedMsg) + if (shill_error_name == shill::kErrorPinBlockedMsg) return NetworkDeviceHandler::kErrorPinBlocked; - if (shill_error_name == flimflam::kErrorPinRequiredMsg) + if (shill_error_name == shill::kErrorPinRequiredMsg) return NetworkDeviceHandler::kErrorPinRequired; return NetworkDeviceHandler::kErrorUnknown; } @@ -73,13 +73,13 @@ void RefreshIPConfigsCallback( const base::DictionaryValue& properties) { const ListValue* ip_configs; if (!properties.GetListWithoutPathExpansion( - flimflam::kIPConfigsProperty, &ip_configs)) { + shill::kIPConfigsProperty, &ip_configs)) { NET_LOG_ERROR("RequestRefreshIPConfigs Failed", device_path); network_handler::ShillErrorCallbackFunction( "RequestRefreshIPConfigs Failed", device_path, error_callback, - std::string("Missing ") + flimflam::kIPConfigsProperty, ""); + std::string("Missing ") + shill::kIPConfigsProperty, ""); return; } diff --git a/chromeos/network/network_device_handler_unittest.cc b/chromeos/network/network_device_handler_unittest.cc index ff58e6b..dd9667a 100644 --- a/chromeos/network/network_device_handler_unittest.cc +++ b/chromeos/network/network_device_handler_unittest.cc @@ -44,20 +44,19 @@ class NetworkDeviceHandlerTest : public testing::Test { DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface(); device_test->ClearDevices(); device_test->AddDevice( - kDefaultCellularDevicePath, flimflam::kTypeCellular, "cellular1"); - device_test->AddDevice( - kDefaultWifiDevicePath, flimflam::kTypeWifi, "wifi1"); + kDefaultCellularDevicePath, shill::kTypeCellular, "cellular1"); + device_test->AddDevice(kDefaultWifiDevicePath, shill::kTypeWifi, "wifi1"); base::FundamentalValue allow_roaming(false); device_test->SetDeviceProperty( kDefaultCellularDevicePath, - flimflam::kCellularAllowRoamingProperty, + shill::kCellularAllowRoamingProperty, allow_roaming); base::ListValue test_ip_configs; test_ip_configs.AppendString("ip_config1"); device_test->SetDeviceProperty( - kDefaultWifiDevicePath, flimflam::kIPConfigsProperty, test_ip_configs); + kDefaultWifiDevicePath, shill::kIPConfigsProperty, test_ip_configs); } virtual void TearDown() OVERRIDE { @@ -170,8 +169,8 @@ TEST_F(NetworkDeviceHandlerTest, GetDeviceProperties) { message_loop_.RunUntilIdle(); EXPECT_EQ(kResultSuccess, result_); std::string type; - properties_->GetString(flimflam::kTypeProperty, &type); - EXPECT_EQ(flimflam::kTypeWifi, type); + properties_->GetString(shill::kTypeProperty, &type); + EXPECT_EQ(shill::kTypeWifi, type); } TEST_F(NetworkDeviceHandlerTest, SetDeviceProperty) { @@ -184,15 +183,15 @@ TEST_F(NetworkDeviceHandlerTest, SetDeviceProperty) { EXPECT_EQ(kResultSuccess, result_); bool allow_roaming; EXPECT_TRUE(properties_->GetBooleanWithoutPathExpansion( - flimflam::kCellularAllowRoamingProperty, &allow_roaming)); + shill::kCellularAllowRoamingProperty, &allow_roaming)); EXPECT_FALSE(allow_roaming); - // Set the flimflam::kCellularAllowRoamingProperty to true. The call + // Set the shill::kCellularAllowRoamingProperty to true. The call // should succeed and the value should be set. base::FundamentalValue allow_roaming_value(true); network_device_handler_->SetDeviceProperty( kDefaultCellularDevicePath, - flimflam::kCellularAllowRoamingProperty, + shill::kCellularAllowRoamingProperty, allow_roaming_value, success_callback_, error_callback_); @@ -207,13 +206,13 @@ TEST_F(NetworkDeviceHandlerTest, SetDeviceProperty) { message_loop_.RunUntilIdle(); EXPECT_EQ(kResultSuccess, result_); EXPECT_TRUE(properties_->GetBooleanWithoutPathExpansion( - flimflam::kCellularAllowRoamingProperty, &allow_roaming)); + shill::kCellularAllowRoamingProperty, &allow_roaming)); EXPECT_TRUE(allow_roaming); // Set property on an invalid path. network_device_handler_->SetDeviceProperty( "/device/invalid_path", - flimflam::kCellularAllowRoamingProperty, + shill::kCellularAllowRoamingProperty, allow_roaming_value, success_callback_, error_callback_); diff --git a/chromeos/network/network_profile_handler.cc b/chromeos/network/network_profile_handler.cc index 26b1bef..19a47b6 100644 --- a/chromeos/network/network_profile_handler.cc +++ b/chromeos/network/network_profile_handler.cc @@ -75,18 +75,18 @@ void NetworkProfileHandler::GetManagerPropertiesCallback( } const base::Value* profiles = NULL; - properties.GetWithoutPathExpansion(flimflam::kProfilesProperty, &profiles); + properties.GetWithoutPathExpansion(shill::kProfilesProperty, &profiles); if (!profiles) { LOG(ERROR) << "Manager properties returned from Shill don't contain " - << "the field " << flimflam::kProfilesProperty; + << "the field " << shill::kProfilesProperty; return; } - OnPropertyChanged(flimflam::kProfilesProperty, *profiles); + OnPropertyChanged(shill::kProfilesProperty, *profiles); } void NetworkProfileHandler::OnPropertyChanged(const std::string& name, const base::Value& value) { - if (name != flimflam::kProfilesProperty) + if (name != shill::kProfilesProperty) return; const base::ListValue* profiles_value = NULL; @@ -141,8 +141,7 @@ void NetworkProfileHandler::GetProfilePropertiesCallback( const std::string& profile_path, const base::DictionaryValue& properties) { std::string userhash; - properties.GetStringWithoutPathExpansion(shill::kUserHashProperty, - &userhash); + properties.GetStringWithoutPathExpansion(shill::kUserHashProperty, &userhash); AddProfile(NetworkProfile(profile_path, userhash)); } diff --git a/chromeos/network/network_sms_handler.cc b/chromeos/network/network_sms_handler.cc index 986317d..ecbafe9 100644 --- a/chromeos/network/network_sms_handler.cc +++ b/chromeos/network/network_sms_handler.cc @@ -378,7 +378,7 @@ void NetworkSmsHandler::RemoveObserver(Observer* observer) { void NetworkSmsHandler::OnPropertyChanged(const std::string& name, const base::Value& value) { - if (name != flimflam::kDevicesProperty) + if (name != shill::kDevicesProperty) return; const base::ListValue* devices = NULL; if (!value.GetAsList(&devices) || !devices) @@ -414,10 +414,10 @@ void NetworkSmsHandler::ManagerPropertiesCallback( return; } const base::Value* value; - if (!properties.GetWithoutPathExpansion(flimflam::kDevicesProperty, &value) || + if (!properties.GetWithoutPathExpansion(shill::kDevicesProperty, &value) || value->GetType() != base::Value::TYPE_LIST) { LOG(ERROR) << "NetworkSmsHandler: No list value for: " - << flimflam::kDevicesProperty; + << shill::kDevicesProperty; return; } const base::ListValue* devices = static_cast<const base::ListValue*>(value); @@ -453,23 +453,23 @@ void NetworkSmsHandler::DevicePropertiesCallback( std::string device_type; if (!properties.GetStringWithoutPathExpansion( - flimflam::kTypeProperty, &device_type)) { + shill::kTypeProperty, &device_type)) { LOG(ERROR) << "NetworkSmsHandler: No type for: " << device_path; return; } - if (device_type != flimflam::kTypeCellular) + if (device_type != shill::kTypeCellular) return; std::string dbus_connection; if (!properties.GetStringWithoutPathExpansion( - flimflam::kDBusConnectionProperty, &dbus_connection)) { + shill::kDBusConnectionProperty, &dbus_connection)) { LOG(ERROR) << "Device has no DBusConnection Property: " << device_path; return; } std::string object_path_string; if (!properties.GetStringWithoutPathExpansion( - flimflam::kDBusObjectProperty, &object_path_string)) { + shill::kDBusObjectProperty, &object_path_string)) { LOG(ERROR) << "Device has no DBusObject Property: " << device_path; return; } diff --git a/chromeos/network/network_sms_handler_unittest.cc b/chromeos/network/network_sms_handler_unittest.cc index c7eaac2..c3d434b 100644 --- a/chromeos/network/network_sms_handler_unittest.cc +++ b/chromeos/network/network_sms_handler_unittest.cc @@ -69,7 +69,7 @@ class NetworkSmsHandlerTest : public testing::Test { ShillDeviceClient::TestInterface* device_test = DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface(); ASSERT_TRUE(device_test); - device_test->AddDevice("stub_cellular_device2", flimflam::kTypeCellular, + device_test->AddDevice("stub_cellular_device2", shill::kTypeCellular, "/org/freedesktop/ModemManager1/stub/0"); // This relies on the stub dbus implementations for ShillManagerClient, diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc index 24d194a..3a0a1fb 100644 --- a/chromeos/network/network_state.cc +++ b/chromeos/network/network_state.cc @@ -29,24 +29,24 @@ bool ConvertListValueToStringVector(const base::ListValue& string_list, bool IsCaCertNssSet(const base::DictionaryValue& properties) { std::string ca_cert_nss; - if (properties.GetStringWithoutPathExpansion(flimflam::kEapCaCertNssProperty, + if (properties.GetStringWithoutPathExpansion(shill::kEapCaCertNssProperty, &ca_cert_nss) && !ca_cert_nss.empty()) { return true; } const base::DictionaryValue* provider = NULL; - properties.GetDictionaryWithoutPathExpansion(flimflam::kProviderProperty, + properties.GetDictionaryWithoutPathExpansion(shill::kProviderProperty, &provider); if (!provider) return false; if (provider->GetStringWithoutPathExpansion( - flimflam::kL2tpIpsecCaCertNssProperty, &ca_cert_nss) && + shill::kL2tpIpsecCaCertNssProperty, &ca_cert_nss) && !ca_cert_nss.empty()) { return true; } if (provider->GetStringWithoutPathExpansion( - flimflam::kOpenVPNCaCertNSSProperty, &ca_cert_nss) && + shill::kOpenVPNCaCertNSSProperty, &ca_cert_nss) && !ca_cert_nss.empty()) { return true; } @@ -76,31 +76,31 @@ bool NetworkState::PropertyChanged(const std::string& key, // Keep care that these properties are the same as in |GetProperties|. if (ManagedStatePropertyChanged(key, value)) return true; - if (key == flimflam::kSignalStrengthProperty) { + if (key == shill::kSignalStrengthProperty) { return GetIntegerValue(key, value, &signal_strength_); - } else if (key == flimflam::kStateProperty) { + } else if (key == shill::kStateProperty) { return GetStringValue(key, value, &connection_state_); - } else if (key == flimflam::kConnectableProperty) { + } else if (key == shill::kConnectableProperty) { return GetBooleanValue(key, value, &connectable_); - } else if (key == flimflam::kErrorProperty) { + } else if (key == shill::kErrorProperty) { if (!GetStringValue(key, value, &error_)) return false; // Shill uses "Unknown" to indicate an unset error state. if (error_ == kErrorUnknown) error_.clear(); return true; - } else if (key == IPConfigProperty(flimflam::kAddressProperty)) { + } else if (key == IPConfigProperty(shill::kAddressProperty)) { return GetStringValue(key, value, &ip_address_); - } else if (key == IPConfigProperty(flimflam::kGatewayProperty)) { + } else if (key == IPConfigProperty(shill::kGatewayProperty)) { return GetStringValue(key, value, &gateway_); - } else if (key == IPConfigProperty(flimflam::kNameServersProperty)) { + } else if (key == IPConfigProperty(shill::kNameServersProperty)) { const base::ListValue* dns_servers; if (!value.GetAsList(&dns_servers)) return false; dns_servers_.clear(); ConvertListValueToStringVector(*dns_servers, &dns_servers_); return true; - } else if (key == IPConfigProperty(flimflam::kPrefixlenProperty)) { + } else if (key == IPConfigProperty(shill::kPrefixlenProperty)) { return GetIntegerValue(key, value, &prefix_length_); } else if (key == IPConfigProperty( shill::kWebProxyAutoDiscoveryUrlProperty)) { @@ -120,13 +120,13 @@ bool NetworkState::PropertyChanged(const std::string& key, } } return true; - } else if (key == flimflam::kActivationStateProperty) { + } else if (key == shill::kActivationStateProperty) { return GetStringValue(key, value, &activation_state_); - } else if (key == flimflam::kRoamingStateProperty) { + } else if (key == shill::kRoamingStateProperty) { return GetStringValue(key, value, &roaming_); - } else if (key == flimflam::kSecurityProperty) { + } else if (key == shill::kSecurityProperty) { return GetStringValue(key, value, &security_); - } else if (key == flimflam::kProxyConfigProperty) { + } else if (key == shill::kProxyConfigProperty) { std::string proxy_config_str; if (!value.GetAsString(&proxy_config_str)) { NET_LOG_ERROR("Failed to parse " + key, path()); @@ -149,7 +149,7 @@ bool NetworkState::PropertyChanged(const std::string& key, NET_LOG_ERROR("Failed to parse " + key, path()); } return true; - } else if (key == flimflam::kUIDataProperty) { + } else if (key == shill::kUIDataProperty) { scoped_ptr<NetworkUIData> new_ui_data = shill_property_util::GetUIDataFromValue(value); if (!new_ui_data) { @@ -158,13 +158,13 @@ bool NetworkState::PropertyChanged(const std::string& key, } ui_data_ = *new_ui_data; return true; - } else if (key == flimflam::kNetworkTechnologyProperty) { + } else if (key == shill::kNetworkTechnologyProperty) { return GetStringValue(key, value, &network_technology_); - } else if (key == flimflam::kDeviceProperty) { + } else if (key == shill::kDeviceProperty) { return GetStringValue(key, value, &device_path_); - } else if (key == flimflam::kGuidProperty) { + } else if (key == shill::kGuidProperty) { return GetStringValue(key, value, &guid_); - } else if (key == flimflam::kProfileProperty) { + } else if (key == shill::kProfileProperty) { return GetStringValue(key, value, &profile_path_); } else if (key == shill::kActivateOverNonCellularNetworkProperty) { return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); @@ -186,27 +186,26 @@ bool NetworkState::InitialPropertiesReceived( void NetworkState::GetProperties(base::DictionaryValue* dictionary) const { // Keep care that these properties are the same as in |PropertyChanged|. - dictionary->SetStringWithoutPathExpansion(flimflam::kNameProperty, name()); - dictionary->SetStringWithoutPathExpansion(flimflam::kTypeProperty, type()); - dictionary->SetIntegerWithoutPathExpansion(flimflam::kSignalStrengthProperty, + dictionary->SetStringWithoutPathExpansion(shill::kNameProperty, name()); + dictionary->SetStringWithoutPathExpansion(shill::kTypeProperty, type()); + dictionary->SetIntegerWithoutPathExpansion(shill::kSignalStrengthProperty, signal_strength_); - dictionary->SetStringWithoutPathExpansion(flimflam::kStateProperty, + dictionary->SetStringWithoutPathExpansion(shill::kStateProperty, connection_state_); - dictionary->SetBooleanWithoutPathExpansion(flimflam::kConnectableProperty, + dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty, connectable_); - dictionary->SetStringWithoutPathExpansion(flimflam::kErrorProperty, - error_); + dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error_); // IPConfig properties base::DictionaryValue* ipconfig_properties = new base::DictionaryValue; - ipconfig_properties->SetStringWithoutPathExpansion(flimflam::kAddressProperty, + ipconfig_properties->SetStringWithoutPathExpansion(shill::kAddressProperty, ip_address_); - ipconfig_properties->SetStringWithoutPathExpansion(flimflam::kGatewayProperty, + ipconfig_properties->SetStringWithoutPathExpansion(shill::kGatewayProperty, gateway_); base::ListValue* name_servers = new base::ListValue; name_servers->AppendStrings(dns_servers_); - ipconfig_properties->SetWithoutPathExpansion(flimflam::kNameServersProperty, + ipconfig_properties->SetWithoutPathExpansion(shill::kNameServersProperty, name_servers); ipconfig_properties->SetStringWithoutPathExpansion( shill::kWebProxyAutoDiscoveryUrlProperty, @@ -214,11 +213,11 @@ void NetworkState::GetProperties(base::DictionaryValue* dictionary) const { dictionary->SetWithoutPathExpansion(shill::kIPConfigProperty, ipconfig_properties); - dictionary->SetStringWithoutPathExpansion(flimflam::kActivationStateProperty, + dictionary->SetStringWithoutPathExpansion(shill::kActivationStateProperty, activation_state_); - dictionary->SetStringWithoutPathExpansion(flimflam::kRoamingStateProperty, + dictionary->SetStringWithoutPathExpansion(shill::kRoamingStateProperty, roaming_); - dictionary->SetStringWithoutPathExpansion(flimflam::kSecurityProperty, + dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty, security_); // Proxy config and ONC source are intentionally omitted: These properties are // placed in NetworkState to transition ProxyConfigServiceImpl from @@ -226,12 +225,12 @@ void NetworkState::GetProperties(base::DictionaryValue* dictionary) const { // shouldn't depend on this member. Once ManagedNetworkConfigurationHandler // is used instead of NetworkLibrary, we can remove them again. dictionary->SetStringWithoutPathExpansion( - flimflam::kNetworkTechnologyProperty, + shill::kNetworkTechnologyProperty, network_technology_); - dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, + dictionary->SetStringWithoutPathExpansion(shill::kDeviceProperty, device_path_); - dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); - dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, + dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid_); + dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty, profile_path_); dictionary->SetBooleanWithoutPathExpansion( shill::kActivateOverNonCellularNetworkProperty, @@ -241,9 +240,9 @@ void NetworkState::GetProperties(base::DictionaryValue* dictionary) const { } bool NetworkState::RequiresActivation() const { - return (type() == flimflam::kTypeCellular && - activation_state() != flimflam::kActivationStateActivated && - activation_state() != flimflam::kActivationStateUnknown); + return (type() == shill::kTypeCellular && + activation_state() != shill::kActivationStateActivated && + activation_state() != shill::kActivationStateUnknown); } bool NetworkState::IsConnectedState() const { @@ -290,16 +289,16 @@ bool NetworkState::UpdateName(const base::DictionaryValue& properties) { // static bool NetworkState::StateIsConnected(const std::string& connection_state) { - return (connection_state == flimflam::kStateReady || - connection_state == flimflam::kStateOnline || - connection_state == flimflam::kStatePortal); + return (connection_state == shill::kStateReady || + connection_state == shill::kStateOnline || + connection_state == shill::kStatePortal); } // static bool NetworkState::StateIsConnecting(const std::string& connection_state) { - return (connection_state == flimflam::kStateAssociation || - connection_state == flimflam::kStateConfiguration || - connection_state == flimflam::kStateCarrier); + return (connection_state == shill::kStateAssociation || + connection_state == shill::kStateConfiguration || + connection_state == shill::kStateCarrier); } // static diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc index c8516d6..64b96a9 100644 --- a/chromeos/network/network_state_handler.cc +++ b/chromeos/network/network_state_handler.cc @@ -29,7 +29,7 @@ namespace { bool ConnectionStateChanged(NetworkState* network, const std::string& prev_connection_state) { return (network->connection_state() != prev_connection_state) && - (network->connection_state() != flimflam::kStateIdle || + (network->connection_state() != shill::kStateIdle || !prev_connection_state.empty()); } @@ -330,7 +330,7 @@ void NetworkStateHandler::WaitForScan(const std::string& type, void NetworkStateHandler::ConnectToBestWifiNetwork() { NET_LOG_USER("ConnectToBestWifiNetwork", ""); - WaitForScan(flimflam::kTypeWifi, + WaitForScan(shill::kTypeWifi, base::Bind(&internal::ShillPropertyHandler::ConnectToBestServices, shill_property_handler_->AsWeakPtr())); } @@ -507,7 +507,7 @@ void NetworkStateHandler::UpdateNetworkServiceProperty( if (!network->PropertyChanged(key, value)) return; - if (key == flimflam::kStateProperty) { + if (key == shill::kStateProperty) { if (ConnectionStateChanged(network, prev_connection_state)) { OnNetworkConnectionStateChanged(network); // If the connection state changes, other properties such as IPConfig @@ -516,7 +516,7 @@ void NetworkStateHandler::UpdateNetworkServiceProperty( } } else { bool noisy_property = - key == flimflam::kSignalStrengthProperty || + key == shill::kSignalStrengthProperty || key == shill::kWifiFrequencyListProperty; if (network->path() == default_network_path_ && !noisy_property) { // Wifi SignalStrength and WifiFrequencyList updates are too noisy, so @@ -532,8 +532,7 @@ void NetworkStateHandler::UpdateNetworkServiceProperty( std::string detail = network->name() + "." + key; detail += " = " + network_event_log::ValueAsString(value); network_event_log::LogLevel log_level; - if (key == flimflam::kErrorProperty || - key == shill::kErrorDetailsProperty) { + if (key == shill::kErrorProperty || key == shill::kErrorDetailsProperty) { log_level = network_event_log::LOG_LEVEL_ERROR; } else { log_level = network_event_log::LOG_LEVEL_EVENT; @@ -559,7 +558,7 @@ void NetworkStateHandler::UpdateDeviceProperty(const std::string& device_path, NotifyDeviceListChanged(); - if (key == flimflam::kScanningProperty && device->scanning() == false) + if (key == shill::kScanningProperty && device->scanning() == false) ScanCompleted(device->type()); } @@ -720,23 +719,23 @@ void NetworkStateHandler::ScanCompleted(const std::string& type) { std::string NetworkStateHandler::GetTechnologyForType( const NetworkTypePattern& type) const { - if (type.MatchesType(flimflam::kTypeEthernet)) - return flimflam::kTypeEthernet; + if (type.MatchesType(shill::kTypeEthernet)) + return shill::kTypeEthernet; - if (type.MatchesType(flimflam::kTypeWifi)) - return flimflam::kTypeWifi; + if (type.MatchesType(shill::kTypeWifi)) + return shill::kTypeWifi; if (type.Equals(NetworkTypePattern::Wimax())) - return flimflam::kTypeWimax; + return shill::kTypeWimax; // Prefer Wimax over Cellular only if it's available. - if (type.MatchesType(flimflam::kTypeWimax) && - shill_property_handler_->IsTechnologyAvailable(flimflam::kTypeWimax)) { - return flimflam::kTypeWimax; + if (type.MatchesType(shill::kTypeWimax) && + shill_property_handler_->IsTechnologyAvailable(shill::kTypeWimax)) { + return shill::kTypeWimax; } - if (type.MatchesType(flimflam::kTypeCellular)) - return flimflam::kTypeCellular; + if (type.MatchesType(shill::kTypeCellular)) + return shill::kTypeCellular; NOTREACHED(); return std::string(); diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h index 14c12a4..3223b1e 100644 --- a/chromeos/network/network_state_handler.h +++ b/chromeos/network/network_state_handler.h @@ -51,7 +51,7 @@ class NetworkTypePattern; // // Most *ByType or *ForType methods will accept any of the following for |type|. // See individual methods for specific notes. -// * Any type defined in service_constants.h (e.g. flimflam::kTypeWifi) +// * Any type defined in service_constants.h (e.g. shill::kTypeWifi) // * kMatchTypeDefault returns the default (active) network // * kMatchTypeNonVirtual returns the primary non virtual network // * kMatchTypeWired returns the primary wired network diff --git a/chromeos/network/network_state_handler_unittest.cc b/chromeos/network/network_state_handler_unittest.cc index 7aa684f..76ccc49 100644 --- a/chromeos/network/network_state_handler_unittest.cc +++ b/chromeos/network/network_state_handler_unittest.cc @@ -164,9 +164,9 @@ class NetworkStateHandlerTest : public testing::Test { DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface(); device_test->ClearDevices(); device_test->AddDevice("/device/stub_wifi_device1", - flimflam::kTypeWifi, "stub_wifi_device1"); + shill::kTypeWifi, "stub_wifi_device1"); device_test->AddDevice("/device/stub_cellular_device1", - flimflam::kTypeCellular, "stub_cellular_device1"); + shill::kTypeCellular, "stub_cellular_device1"); ShillServiceClient::TestInterface* service_test = DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); @@ -175,19 +175,19 @@ class NetworkStateHandlerTest : public testing::Test { const bool add_to_watchlist = true; service_test->AddService(kShillManagerClientStubDefaultService, kShillManagerClientStubDefaultService, - flimflam::kTypeEthernet, flimflam::kStateOnline, + shill::kTypeEthernet, shill::kStateOnline, add_to_visible, add_to_watchlist); service_test->AddService(kShillManagerClientStubDefaultWireless, kShillManagerClientStubDefaultWireless, - flimflam::kTypeWifi, flimflam::kStateOnline, + shill::kTypeWifi, shill::kStateOnline, add_to_visible, add_to_watchlist); service_test->AddService(kShillManagerClientStubWireless2, kShillManagerClientStubWireless2, - flimflam::kTypeWifi, flimflam::kStateIdle, + shill::kTypeWifi, shill::kStateIdle, add_to_visible, add_to_watchlist); service_test->AddService(kShillManagerClientStubCellular, kShillManagerClientStubCellular, - flimflam::kTypeCellular, flimflam::kStateIdle, + shill::kTypeCellular, shill::kStateIdle, add_to_visible, add_to_watchlist); } @@ -223,7 +223,7 @@ TEST_F(NetworkStateHandlerTest, NetworkStateHandlerStub) { kShillManagerClientStubCellular, network_state_handler_->FirstNetworkByType(NetworkTypePattern::Cellular()) ->path()); - EXPECT_EQ(flimflam::kStateOnline, + EXPECT_EQ(shill::kStateOnline, test_observer_->default_network_connection_state()); } @@ -261,25 +261,25 @@ TEST_F(NetworkStateHandlerTest, TechnologyChanged) { TEST_F(NetworkStateHandlerTest, TechnologyState) { ShillManagerClient::TestInterface* manager_test = DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface(); - manager_test->RemoveTechnology(flimflam::kTypeWimax); + manager_test->RemoveTechnology(shill::kTypeWimax); message_loop_.RunUntilIdle(); EXPECT_EQ( NetworkStateHandler::TECHNOLOGY_UNAVAILABLE, network_state_handler_->GetTechnologyState(NetworkTypePattern::Wimax())); - manager_test->AddTechnology(flimflam::kTypeWimax, false); + manager_test->AddTechnology(shill::kTypeWimax, false); message_loop_.RunUntilIdle(); EXPECT_EQ( NetworkStateHandler::TECHNOLOGY_AVAILABLE, network_state_handler_->GetTechnologyState(NetworkTypePattern::Wimax())); - manager_test->SetTechnologyInitializing(flimflam::kTypeWimax, true); + manager_test->SetTechnologyInitializing(shill::kTypeWimax, true); message_loop_.RunUntilIdle(); EXPECT_EQ( NetworkStateHandler::TECHNOLOGY_UNINITIALIZED, network_state_handler_->GetTechnologyState(NetworkTypePattern::Wimax())); - manager_test->SetTechnologyInitializing(flimflam::kTypeWimax, false); + manager_test->SetTechnologyInitializing(shill::kTypeWimax, false); network_state_handler_->SetTechnologyEnabled( NetworkTypePattern::Wimax(), true, network_handler::ErrorCallback()); message_loop_.RunUntilIdle(); @@ -287,7 +287,7 @@ TEST_F(NetworkStateHandlerTest, TechnologyState) { NetworkStateHandler::TECHNOLOGY_ENABLED, network_state_handler_->GetTechnologyState(NetworkTypePattern::Wimax())); - manager_test->RemoveTechnology(flimflam::kTypeWimax); + manager_test->RemoveTechnology(shill::kTypeWimax); message_loop_.RunUntilIdle(); EXPECT_EQ( NetworkStateHandler::TECHNOLOGY_UNAVAILABLE, @@ -302,7 +302,7 @@ TEST_F(NetworkStateHandlerTest, ServicePropertyChanged) { base::StringValue security_value("TestSecurity"); DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(eth1), - flimflam::kSecurityProperty, security_value, + shill::kSecurityProperty, security_value, base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); EXPECT_EQ("TestSecurity", @@ -312,7 +312,7 @@ TEST_F(NetworkStateHandlerTest, ServicePropertyChanged) { // Changing a service to the existing value should not trigger an update. DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(eth1), - flimflam::kSecurityProperty, security_value, + shill::kSecurityProperty, security_value, base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(eth1)); @@ -335,16 +335,16 @@ TEST_F(NetworkStateHandlerTest, NetworkConnectionStateChanged) { ShillServiceClient::TestInterface* service_test = DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); const std::string eth1 = kShillManagerClientStubDefaultService; - base::StringValue connection_state_idle_value(flimflam::kStateIdle); - service_test->SetServiceProperty(eth1, flimflam::kStateProperty, + base::StringValue connection_state_idle_value(shill::kStateIdle); + service_test->SetServiceProperty(eth1, shill::kStateProperty, connection_state_idle_value); message_loop_.RunUntilIdle(); - EXPECT_EQ(flimflam::kStateIdle, + EXPECT_EQ(shill::kStateIdle, test_observer_->NetworkConnectionStateForService(eth1)); EXPECT_EQ(2, test_observer_->ConnectionStateChangesForService(eth1)); // Confirm that changing the connection state to the same value does *not* // signal the observer. - service_test->SetServiceProperty(eth1, flimflam::kStateProperty, + service_test->SetServiceProperty(eth1, shill::kStateProperty, connection_state_idle_value); message_loop_.RunUntilIdle(); EXPECT_EQ(2, test_observer_->ConnectionStateChangesForService(eth1)); @@ -362,12 +362,12 @@ TEST_F(NetworkStateHandlerTest, DefaultServiceChanged) { // should re-sort Manager.Services. const std::string eth1 = kShillManagerClientStubDefaultService; const std::string wifi1 = kShillManagerClientStubDefaultWireless; - base::StringValue connection_state_idle_value(flimflam::kStateIdle); - service_test->SetServiceProperty(eth1, flimflam::kStateProperty, + base::StringValue connection_state_idle_value(shill::kStateIdle); + service_test->SetServiceProperty(eth1, shill::kStateProperty, connection_state_idle_value); message_loop_.RunUntilIdle(); EXPECT_EQ(wifi1, test_observer_->default_network()); - EXPECT_EQ(flimflam::kStateOnline, + EXPECT_EQ(shill::kStateOnline, test_observer_->default_network_connection_state()); // We should have seen 2 default network updates - for the default // service change, and for the state change. @@ -377,7 +377,7 @@ TEST_F(NetworkStateHandlerTest, DefaultServiceChanged) { // a default network change. DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(wifi1), - flimflam::kSecurityProperty, base::StringValue("TestSecurity"), + shill::kSecurityProperty, base::StringValue("TestSecurity"), base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); EXPECT_EQ(3u, test_observer_->default_network_change_count()); @@ -385,7 +385,7 @@ TEST_F(NetworkStateHandlerTest, DefaultServiceChanged) { // No default network updates for signal strength changes. DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(wifi1), - flimflam::kSignalStrengthProperty, base::FundamentalValue(32), + shill::kSignalStrengthProperty, base::FundamentalValue(32), base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); EXPECT_EQ(3u, test_observer_->default_network_change_count()); diff --git a/chromeos/network/network_state_unittest.cc b/chromeos/network/network_state_unittest.cc index 4bb2fac..f652493 100644 --- a/chromeos/network/network_state_unittest.cc +++ b/chromeos/network/network_state_unittest.cc @@ -80,14 +80,14 @@ class NetworkStateTest : public testing::Test { TEST_F(NetworkStateTest, SsidAscii) { std::string wifi_setname = "SSID TEST"; std::string wifi_setname_result = "SSID TEST"; - EXPECT_TRUE(SetStringProperty(flimflam::kNameProperty, wifi_setname)); + EXPECT_TRUE(SetStringProperty(shill::kNameProperty, wifi_setname)); EXPECT_EQ(network_state_.name(), wifi_setname_result); } TEST_F(NetworkStateTest, SsidAsciiWithNull) { std::string wifi_setname = "SSID TEST\x00xxx"; std::string wifi_setname_result = "SSID TEST"; - EXPECT_TRUE(SetStringProperty(flimflam::kNameProperty, wifi_setname)); + EXPECT_TRUE(SetStringProperty(shill::kNameProperty, wifi_setname)); EXPECT_EQ(network_state_.name(), wifi_setname_result); } @@ -95,7 +95,7 @@ TEST_F(NetworkStateTest, SsidAsciiWithNull) { TEST_F(NetworkStateTest, SsidUtf8) { std::string wifi_utf8 = "UTF-8 \u3042\u3044\u3046"; std::string wifi_utf8_result = "UTF-8 \xE3\x81\x82\xE3\x81\x84\xE3\x81\x86"; - EXPECT_TRUE(SetStringProperty(flimflam::kNameProperty, wifi_utf8)); + EXPECT_TRUE(SetStringProperty(shill::kNameProperty, wifi_utf8)); EXPECT_EQ(network_state_.name(), wifi_utf8_result); } @@ -103,7 +103,7 @@ TEST_F(NetworkStateTest, SsidUtf8) { TEST_F(NetworkStateTest, SsidTruncateInvalid) { std::string wifi_setname2 = "SSID TEST \x01\xff!"; std::string wifi_setname2_result = "SSID TEST \xEF\xBF\xBD\xEF\xBF\xBD!"; - EXPECT_TRUE(SetStringProperty(flimflam::kNameProperty, wifi_setname2)); + EXPECT_TRUE(SetStringProperty(shill::kNameProperty, wifi_setname2)); EXPECT_TRUE(SignalInitialPropertiesReceived()); EXPECT_EQ(network_state_.name(), wifi_setname2_result); } @@ -114,7 +114,7 @@ TEST_F(NetworkStateTest, SsidLatin) { std::string wifi_latin1_hex = base::HexEncode(wifi_latin1.c_str(), wifi_latin1.length()); std::string wifi_latin1_result = "latin-1 \u00c0\u00cb\u00cc\u00d6\u00fb"; - EXPECT_FALSE(SetStringProperty(flimflam::kWifiHexSsid, wifi_latin1_hex)); + EXPECT_FALSE(SetStringProperty(shill::kWifiHexSsid, wifi_latin1_hex)); EXPECT_TRUE(SignalInitialPropertiesReceived()); EXPECT_EQ(network_state_.name(), wifi_latin1_result); } @@ -123,7 +123,7 @@ TEST_F(NetworkStateTest, SsidLatin) { TEST_F(NetworkStateTest, SsidHex) { std::string wifi_hex = "5468697320697320484558205353494421"; std::string wifi_hex_result = "This is HEX SSID!"; - EXPECT_FALSE(SetStringProperty(flimflam::kWifiHexSsid, wifi_hex)); + EXPECT_FALSE(SetStringProperty(shill::kWifiHexSsid, wifi_hex)); EXPECT_TRUE(SignalInitialPropertiesReceived()); EXPECT_EQ(network_state_.name(), wifi_hex_result); } diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc index 4b13a15..8b1ff44 100644 --- a/chromeos/network/network_util.cc +++ b/chromeos/network/network_util.cc @@ -104,16 +104,16 @@ bool ParseCellularScanResults( const DictionaryValue* dict = static_cast<const DictionaryValue*>(*it); // If the network id property is not present then this network cannot be // connected to so don't include it in the results. - if (!dict->GetStringWithoutPathExpansion(flimflam::kNetworkIdProperty, + if (!dict->GetStringWithoutPathExpansion(shill::kNetworkIdProperty, &scan_result.network_id)) continue; - dict->GetStringWithoutPathExpansion(flimflam::kStatusProperty, + dict->GetStringWithoutPathExpansion(shill::kStatusProperty, &scan_result.status); - dict->GetStringWithoutPathExpansion(flimflam::kLongNameProperty, + dict->GetStringWithoutPathExpansion(shill::kLongNameProperty, &scan_result.long_name); - dict->GetStringWithoutPathExpansion(flimflam::kShortNameProperty, + dict->GetStringWithoutPathExpansion(shill::kShortNameProperty, &scan_result.short_name); - dict->GetStringWithoutPathExpansion(flimflam::kTechnologyProperty, + dict->GetStringWithoutPathExpansion(shill::kTechnologyProperty, &scan_result.technology); scan_results->push_back(scan_result); } diff --git a/chromeos/network/network_util_unittest.cc b/chromeos/network/network_util_unittest.cc index 17c09bb..f668cf3 100644 --- a/chromeos/network/network_util_unittest.cc +++ b/chromeos/network/network_util_unittest.cc @@ -117,22 +117,22 @@ TEST_F(NetworkUtilTest, ParseScanResults) { // Scan result has no network id. list.Clear(); DictionaryValue* dict_value = new DictionaryValue(); - dict_value->SetString(flimflam::kStatusProperty, "available"); + dict_value->SetString(shill::kStatusProperty, "available"); list.Append(dict_value); EXPECT_TRUE(ParseCellularScanResults(list, &scan_results)); EXPECT_TRUE(scan_results.empty()); // Mixed parse results. dict_value = new DictionaryValue(); - dict_value->SetString(flimflam::kNetworkIdProperty, "000001"); - dict_value->SetString(flimflam::kStatusProperty, "unknown"); - dict_value->SetString(flimflam::kTechnologyProperty, "GSM"); + dict_value->SetString(shill::kNetworkIdProperty, "000001"); + dict_value->SetString(shill::kStatusProperty, "unknown"); + dict_value->SetString(shill::kTechnologyProperty, "GSM"); list.Append(dict_value); dict_value = new DictionaryValue(); - dict_value->SetString(flimflam::kNetworkIdProperty, "000002"); - dict_value->SetString(flimflam::kStatusProperty, "available"); - dict_value->SetString(flimflam::kLongNameProperty, "Long Name"); + dict_value->SetString(shill::kNetworkIdProperty, "000002"); + dict_value->SetString(shill::kStatusProperty, "available"); + dict_value->SetString(shill::kLongNameProperty, "Long Name"); list.Append(dict_value); EXPECT_TRUE(ParseCellularScanResults(list, &scan_results)); diff --git a/chromeos/network/onc/onc_translation_tables.cc b/chromeos/network/onc/onc_translation_tables.cc index 0cc2b6b..690df0b 100644 --- a/chromeos/network/onc/onc_translation_tables.cc +++ b/chromeos/network/onc/onc_translation_tables.cc @@ -24,150 +24,150 @@ namespace onc { namespace { const FieldTranslationEntry eap_fields[] = { - { eap::kAnonymousIdentity, flimflam::kEapAnonymousIdentityProperty }, - { eap::kIdentity, flimflam::kEapIdentityProperty }, + { eap::kAnonymousIdentity, shill::kEapAnonymousIdentityProperty }, + { eap::kIdentity, shill::kEapIdentityProperty }, // This field is converted during translation, see onc_translator_*. - // { eap::kInner, flimflam::kEapPhase2AuthProperty }, + // { eap::kInner, shill::kEapPhase2AuthProperty }, // This field is converted during translation, see onc_translator_*. - // { eap::kOuter, flimflam::kEapMethodProperty }, - { eap::kPassword, flimflam::kEapPasswordProperty }, - { eap::kSaveCredentials, flimflam::kSaveCredentialsProperty }, + // { eap::kOuter, shill::kEapMethodProperty }, + { eap::kPassword, shill::kEapPasswordProperty }, + { eap::kSaveCredentials, shill::kSaveCredentialsProperty }, { eap::kServerCAPEMs, shill::kEapCaCertPemProperty }, - { eap::kUseSystemCAs, flimflam::kEapUseSystemCasProperty }, + { eap::kUseSystemCAs, shill::kEapUseSystemCasProperty }, { NULL } }; const FieldTranslationEntry ipsec_fields[] = { // Ignored by Shill, not necessary to synchronize. - // { ipsec::kAuthenticationType, flimflam::kL2tpIpsecAuthenticationType }, + // { ipsec::kAuthenticationType, shill::kL2tpIpsecAuthenticationType }, { ipsec::kGroup, shill::kL2tpIpsecTunnelGroupProperty }, // Ignored by Shill, not necessary to synchronize. - // { ipsec::kIKEVersion, flimflam::kL2tpIpsecIkeVersion }, - { ipsec::kPSK, flimflam::kL2tpIpsecPskProperty }, - { vpn::kSaveCredentials, flimflam::kSaveCredentialsProperty }, + // { ipsec::kIKEVersion, shill::kL2tpIpsecIkeVersion }, + { ipsec::kPSK, shill::kL2tpIpsecPskProperty }, + { vpn::kSaveCredentials, shill::kSaveCredentialsProperty }, { ipsec::kServerCAPEMs, shill::kL2tpIpsecCaCertPemProperty }, { NULL } }; const FieldTranslationEntry l2tp_fields[] = { - { vpn::kPassword, flimflam::kL2tpIpsecPasswordProperty }, + { vpn::kPassword, shill::kL2tpIpsecPasswordProperty }, // We don't synchronize l2tp's SaveCredentials field for now, as Shill doesn't // support separate settings for ipsec and l2tp. // { vpn::kSaveCredentials, &kBoolSignature }, - { vpn::kUsername, flimflam::kL2tpIpsecUserProperty }, + { vpn::kUsername, shill::kL2tpIpsecUserProperty }, { NULL } }; const FieldTranslationEntry openvpn_fields[] = { - { openvpn::kAuth, flimflam::kOpenVPNAuthProperty }, - { openvpn::kAuthNoCache, flimflam::kOpenVPNAuthNoCacheProperty }, - { openvpn::kAuthRetry, flimflam::kOpenVPNAuthRetryProperty }, - { openvpn::kCipher, flimflam::kOpenVPNCipherProperty }, - { openvpn::kCompLZO, flimflam::kOpenVPNCompLZOProperty }, - { openvpn::kCompNoAdapt, flimflam::kOpenVPNCompNoAdaptProperty }, - { openvpn::kKeyDirection, flimflam::kOpenVPNKeyDirectionProperty }, - { openvpn::kNsCertType, flimflam::kOpenVPNNsCertTypeProperty }, - { vpn::kPassword, flimflam::kOpenVPNPasswordProperty }, - { openvpn::kPort, flimflam::kOpenVPNPortProperty }, - { openvpn::kProto, flimflam::kOpenVPNProtoProperty }, - { openvpn::kPushPeerInfo, flimflam::kOpenVPNPushPeerInfoProperty }, - { openvpn::kRemoteCertEKU, flimflam::kOpenVPNRemoteCertEKUProperty }, + { openvpn::kAuth, shill::kOpenVPNAuthProperty }, + { openvpn::kAuthNoCache, shill::kOpenVPNAuthNoCacheProperty }, + { openvpn::kAuthRetry, shill::kOpenVPNAuthRetryProperty }, + { openvpn::kCipher, shill::kOpenVPNCipherProperty }, + { openvpn::kCompLZO, shill::kOpenVPNCompLZOProperty }, + { openvpn::kCompNoAdapt, shill::kOpenVPNCompNoAdaptProperty }, + { openvpn::kKeyDirection, shill::kOpenVPNKeyDirectionProperty }, + { openvpn::kNsCertType, shill::kOpenVPNNsCertTypeProperty }, + { vpn::kPassword, shill::kOpenVPNPasswordProperty }, + { openvpn::kPort, shill::kOpenVPNPortProperty }, + { openvpn::kProto, shill::kOpenVPNProtoProperty }, + { openvpn::kPushPeerInfo, shill::kOpenVPNPushPeerInfoProperty }, + { openvpn::kRemoteCertEKU, shill::kOpenVPNRemoteCertEKUProperty }, // This field is converted during translation, see onc_translator_*. - // { openvpn::kRemoteCertKU, flimflam::kOpenVPNRemoteCertKUProperty }, - { openvpn::kRemoteCertTLS, flimflam::kOpenVPNRemoteCertTLSProperty }, - { openvpn::kRenegSec, flimflam::kOpenVPNRenegSecProperty }, - { vpn::kSaveCredentials, flimflam::kSaveCredentialsProperty }, + // { openvpn::kRemoteCertKU, shill::kOpenVPNRemoteCertKUProperty }, + { openvpn::kRemoteCertTLS, shill::kOpenVPNRemoteCertTLSProperty }, + { openvpn::kRenegSec, shill::kOpenVPNRenegSecProperty }, + { vpn::kSaveCredentials, shill::kSaveCredentialsProperty }, { openvpn::kServerCAPEMs, shill::kOpenVPNCaCertPemProperty }, - { openvpn::kServerPollTimeout, flimflam::kOpenVPNServerPollTimeoutProperty }, - { openvpn::kShaper, flimflam::kOpenVPNShaperProperty }, - { openvpn::kStaticChallenge, flimflam::kOpenVPNStaticChallengeProperty }, - { openvpn::kTLSAuthContents, flimflam::kOpenVPNTLSAuthContentsProperty }, - { openvpn::kTLSRemote, flimflam::kOpenVPNTLSRemoteProperty }, - { vpn::kUsername, flimflam::kOpenVPNUserProperty }, + { openvpn::kServerPollTimeout, shill::kOpenVPNServerPollTimeoutProperty }, + { openvpn::kShaper, shill::kOpenVPNShaperProperty }, + { openvpn::kStaticChallenge, shill::kOpenVPNStaticChallengeProperty }, + { openvpn::kTLSAuthContents, shill::kOpenVPNTLSAuthContentsProperty }, + { openvpn::kTLSRemote, shill::kOpenVPNTLSRemoteProperty }, + { vpn::kUsername, shill::kOpenVPNUserProperty }, { NULL } }; const FieldTranslationEntry vpn_fields[] = { - { vpn::kAutoConnect, flimflam::kAutoConnectProperty }, - { vpn::kHost, flimflam::kProviderHostProperty }, + { vpn::kAutoConnect, shill::kAutoConnectProperty }, + { vpn::kHost, shill::kProviderHostProperty }, // This field is converted during translation, see onc_translator_*. - // { vpn::kType, flimflam::kProviderTypeProperty }, + // { vpn::kType, shill::kProviderTypeProperty }, { NULL } }; const FieldTranslationEntry wifi_fields[] = { - { wifi::kAutoConnect, flimflam::kAutoConnectProperty }, - { wifi::kBSSID, flimflam::kWifiBSsid }, - { wifi::kFrequency, flimflam::kWifiFrequency }, + { wifi::kAutoConnect, shill::kAutoConnectProperty }, + { wifi::kBSSID, shill::kWifiBSsid }, + { wifi::kFrequency, shill::kWifiFrequency }, { wifi::kFrequencyList, shill::kWifiFrequencyListProperty }, - { wifi::kHiddenSSID, flimflam::kWifiHiddenSsid }, - { wifi::kPassphrase, flimflam::kPassphraseProperty }, - { wifi::kSSID, flimflam::kSSIDProperty }, + { wifi::kHiddenSSID, shill::kWifiHiddenSsid }, + { wifi::kPassphrase, shill::kPassphraseProperty }, + { wifi::kSSID, shill::kSSIDProperty }, // This field is converted during translation, see onc_translator_*. - // { wifi::kSecurity, flimflam::kSecurityProperty }, - { wifi::kSignalStrength, flimflam::kSignalStrengthProperty }, + // { wifi::kSecurity, shill::kSecurityProperty }, + { wifi::kSignalStrength, shill::kSignalStrengthProperty }, { NULL } }; const FieldTranslationEntry cellular_apn_fields[] = { - { cellular_apn::kName, flimflam::kApnProperty }, - { cellular_apn::kUsername, flimflam::kApnUsernameProperty }, - { cellular_apn::kPassword, flimflam::kApnPasswordProperty }, + { cellular_apn::kName, shill::kApnProperty }, + { cellular_apn::kUsername, shill::kApnUsernameProperty }, + { cellular_apn::kPassword, shill::kApnPasswordProperty }, { NULL } }; const FieldTranslationEntry cellular_provider_fields[] = { - { cellular_provider::kCode, flimflam::kOperatorCodeKey }, - { cellular_provider::kCountry, flimflam::kOperatorCountryKey }, - { cellular_provider::kName, flimflam::kOperatorNameKey }, + { cellular_provider::kCode, shill::kOperatorCodeKey }, + { cellular_provider::kCountry, shill::kOperatorCountryKey }, + { cellular_provider::kName, shill::kOperatorNameKey }, { NULL } }; const FieldTranslationEntry cellular_fields[] = { { cellular::kActivateOverNonCellularNetwork, shill::kActivateOverNonCellularNetworkProperty }, - { cellular::kActivationState, flimflam::kActivationStateProperty }, - { cellular::kAllowRoaming, flimflam::kCellularAllowRoamingProperty }, - { cellular::kCarrier, flimflam::kCarrierProperty }, - { cellular::kESN, flimflam::kEsnProperty }, - { cellular::kFamily, flimflam::kTechnologyFamilyProperty }, - { cellular::kFirmwareRevision, flimflam::kFirmwareRevisionProperty }, - { cellular::kFoundNetworks, flimflam::kFoundNetworksProperty }, - { cellular::kHardwareRevision, flimflam::kHardwareRevisionProperty }, - { cellular::kICCID, flimflam::kIccidProperty }, - { cellular::kIMEI, flimflam::kImeiProperty }, - { cellular::kIMSI, flimflam::kImsiProperty }, - { cellular::kManufacturer, flimflam::kManufacturerProperty }, - { cellular::kMDN, flimflam::kMdnProperty }, - { cellular::kMEID, flimflam::kMeidProperty }, - { cellular::kMIN, flimflam::kMinProperty }, - { cellular::kModelID, flimflam::kModelIDProperty }, - { cellular::kNetworkTechnology, flimflam::kNetworkTechnologyProperty }, - { cellular::kPRLVersion, flimflam::kPRLVersionProperty }, + { cellular::kActivationState, shill::kActivationStateProperty }, + { cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty }, + { cellular::kCarrier, shill::kCarrierProperty }, + { cellular::kESN, shill::kEsnProperty }, + { cellular::kFamily, shill::kTechnologyFamilyProperty }, + { cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty }, + { cellular::kFoundNetworks, shill::kFoundNetworksProperty }, + { cellular::kHardwareRevision, shill::kHardwareRevisionProperty }, + { cellular::kICCID, shill::kIccidProperty }, + { cellular::kIMEI, shill::kImeiProperty }, + { cellular::kIMSI, shill::kImsiProperty }, + { cellular::kManufacturer, shill::kManufacturerProperty }, + { cellular::kMDN, shill::kMdnProperty }, + { cellular::kMEID, shill::kMeidProperty }, + { cellular::kMIN, shill::kMinProperty }, + { cellular::kModelID, shill::kModelIDProperty }, + { cellular::kNetworkTechnology, shill::kNetworkTechnologyProperty }, + { cellular::kPRLVersion, shill::kPRLVersionProperty }, { cellular::kProviderRequiresRoaming, shill::kProviderRequiresRoamingProperty }, - { cellular::kRoamingState, flimflam::kRoamingStateProperty }, - { cellular::kSelectedNetwork, flimflam::kSelectedNetworkProperty }, - { cellular::kSIMLockStatus, flimflam::kSIMLockStatusProperty }, + { cellular::kRoamingState, shill::kRoamingStateProperty }, + { cellular::kSelectedNetwork, shill::kSelectedNetworkProperty }, + { cellular::kSIMLockStatus, shill::kSIMLockStatusProperty }, { cellular::kSIMPresent, shill::kSIMPresentProperty }, { cellular::kSupportedCarriers, shill::kSupportedCarriersProperty }, - { cellular::kSupportNetworkScan, flimflam::kSupportNetworkScanProperty }, + { cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty }, { NULL } }; const FieldTranslationEntry network_fields[] = { // Shill doesn't allow setting the name for non-VPN networks. // This field is conditionally translated, see onc_translator_*. - // { network_config::kName, flimflam::kNameProperty }, - { network_config::kGUID, flimflam::kGuidProperty }, + // { network_config::kName, shill::kNameProperty }, + { network_config::kGUID, shill::kGuidProperty }, // This field is converted during translation, see onc_translator_*. - // { network_config::kType, flimflam::kTypeProperty }, + // { network_config::kType, shill::kTypeProperty }, // This field is converted during translation, see // onc_translator_shill_to_onc.cc. It is only converted when going from // Shill->ONC, and ignored otherwise. - // { network_config::kConnectionState, flimflam::kStateProperty }, + // { network_config::kConnectionState, shill::kStateProperty }, { NULL } }; @@ -200,7 +200,7 @@ struct NestedShillDictionaryEntry { }; const char* cellular_apn_property_path_entries[] = { - flimflam::kCellularApnProperty, + shill::kCellularApnProperty, NULL }; @@ -213,51 +213,51 @@ const NestedShillDictionaryEntry nested_shill_dictionaries[] = { const StringTranslationEntry kNetworkTypeTable[] = { // This mapping is ensured in the translation code. - // { network_type::kEthernet, flimflam::kTypeEthernet }, + // { network_type::kEthernet, shill::kTypeEthernet }, // { network_type::kEthernet, shill::kTypeEthernetEap }, - { network_type::kWiFi, flimflam::kTypeWifi }, - { network_type::kCellular, flimflam::kTypeCellular }, - { network_type::kVPN, flimflam::kTypeVPN }, + { network_type::kWiFi, shill::kTypeWifi }, + { network_type::kCellular, shill::kTypeCellular }, + { network_type::kVPN, shill::kTypeVPN }, { NULL } }; const StringTranslationEntry kVPNTypeTable[] = { - { vpn::kTypeL2TP_IPsec, flimflam::kProviderL2tpIpsec }, - { vpn::kOpenVPN, flimflam::kProviderOpenVpn }, + { vpn::kTypeL2TP_IPsec, shill::kProviderL2tpIpsec }, + { vpn::kOpenVPN, shill::kProviderOpenVpn }, { NULL } }; // The first matching line is chosen. const StringTranslationEntry kWiFiSecurityTable[] = { - { wifi::kNone, flimflam::kSecurityNone }, - { wifi::kWEP_PSK, flimflam::kSecurityWep }, - { wifi::kWPA_PSK, flimflam::kSecurityPsk }, - { wifi::kWPA_EAP, flimflam::kSecurity8021x }, - { wifi::kWPA_PSK, flimflam::kSecurityRsn }, - { wifi::kWPA_PSK, flimflam::kSecurityWpa }, + { wifi::kNone, shill::kSecurityNone }, + { wifi::kWEP_PSK, shill::kSecurityWep }, + { wifi::kWPA_PSK, shill::kSecurityPsk }, + { wifi::kWPA_EAP, shill::kSecurity8021x }, + { wifi::kWPA_PSK, shill::kSecurityRsn }, + { wifi::kWPA_PSK, shill::kSecurityWpa }, { NULL } }; const StringTranslationEntry kEAPOuterTable[] = { - { eap::kPEAP, flimflam::kEapMethodPEAP }, - { eap::kEAP_TLS, flimflam::kEapMethodTLS }, - { eap::kEAP_TTLS, flimflam::kEapMethodTTLS }, - { eap::kLEAP, flimflam::kEapMethodLEAP }, + { eap::kPEAP, shill::kEapMethodPEAP }, + { eap::kEAP_TLS, shill::kEapMethodTLS }, + { eap::kEAP_TTLS, shill::kEapMethodTTLS }, + { eap::kLEAP, shill::kEapMethodLEAP }, { NULL } }; // Translation of the EAP.Inner field in case of EAP.Outer == PEAP const StringTranslationEntry kEAP_PEAP_InnerTable[] = { - { eap::kMD5, flimflam::kEapPhase2AuthPEAPMD5 }, - { eap::kMSCHAPv2, flimflam::kEapPhase2AuthPEAPMSCHAPV2 }, + { eap::kMD5, shill::kEapPhase2AuthPEAPMD5 }, + { eap::kMSCHAPv2, shill::kEapPhase2AuthPEAPMSCHAPV2 }, { NULL } }; // Translation of the EAP.Inner field in case of EAP.Outer == TTLS const StringTranslationEntry kEAP_TTLS_InnerTable[] = { - { eap::kMD5, flimflam::kEapPhase2AuthTTLSMD5 }, - { eap::kMSCHAPv2, flimflam::kEapPhase2AuthTTLSMSCHAPV2 }, - { eap::kPAP, flimflam::kEapPhase2AuthTTLSPAP }, + { eap::kMD5, shill::kEapPhase2AuthTTLSMD5 }, + { eap::kMSCHAPv2, shill::kEapPhase2AuthTTLSMSCHAPV2 }, + { eap::kPAP, shill::kEapPhase2AuthTTLSPAP }, { NULL } }; diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc index 8af78d5..f3ac1fc 100644 --- a/chromeos/network/onc/onc_translator_onc_to_shill.cc +++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc @@ -106,10 +106,10 @@ void LocalTranslator::TranslateEthernet() { onc_object_->GetStringWithoutPathExpansion(ethernet::kAuthentication, &authentication); - const char* shill_type = flimflam::kTypeEthernet; + const char* shill_type = shill::kTypeEthernet; if (authentication == ethernet::k8021X) shill_type = shill::kTypeEthernetEap; - shill_dictionary_->SetStringWithoutPathExpansion(flimflam::kTypeProperty, + shill_dictionary_->SetStringWithoutPathExpansion(shill::kTypeProperty, shill_type); CopyFieldsAccordingToSignature(); @@ -124,7 +124,7 @@ void LocalTranslator::TranslateOpenVPN() { &certKUs) && certKUs->GetString(0, &certKU)) { shill_dictionary_->SetStringWithoutPathExpansion( - flimflam::kOpenVPNRemoteCertKUProperty, certKU); + shill::kOpenVPNRemoteCertKUProperty, certKU); } for (base::DictionaryValue::Iterator it(*onc_object_); !it.IsAtEnd(); @@ -145,8 +145,7 @@ void LocalTranslator::TranslateOpenVPN() { void LocalTranslator::TranslateVPN() { std::string type; onc_object_->GetStringWithoutPathExpansion(vpn::kType, &type); - TranslateWithTableAndSet(type, kVPNTypeTable, - flimflam::kProviderTypeProperty); + TranslateWithTableAndSet(type, kVPNTypeTable, shill::kProviderTypeProperty); CopyFieldsAccordingToSignature(); } @@ -155,18 +154,18 @@ void LocalTranslator::TranslateWiFi() { std::string security; onc_object_->GetStringWithoutPathExpansion(wifi::kSecurity, &security); TranslateWithTableAndSet(security, kWiFiSecurityTable, - flimflam::kSecurityProperty); + shill::kSecurityProperty); // We currently only support managed and no adhoc networks. - shill_dictionary_->SetStringWithoutPathExpansion(flimflam::kModeProperty, - flimflam::kModeManaged); + shill_dictionary_->SetStringWithoutPathExpansion(shill::kModeProperty, + shill::kModeManaged); CopyFieldsAccordingToSignature(); } void LocalTranslator::TranslateEAP() { std::string outer; onc_object_->GetStringWithoutPathExpansion(eap::kOuter, &outer); - TranslateWithTableAndSet(outer, kEAPOuterTable, flimflam::kEapMethodProperty); + TranslateWithTableAndSet(outer, kEAPOuterTable, shill::kEapMethodProperty); // Translate the inner protocol only for outer tunneling protocols. if (outer == eap::kPEAP || outer == eap::kEAP_TTLS) { @@ -178,7 +177,7 @@ void LocalTranslator::TranslateEAP() { if (inner != eap::kAutomatic) { const StringTranslationEntry* table = outer == eap::kPEAP ? kEAP_PEAP_InnerTable : kEAP_TTLS_InnerTable; - TranslateWithTableAndSet(inner, table, flimflam::kEapPhase2AuthProperty); + TranslateWithTableAndSet(inner, table, shill::kEapPhase2AuthProperty); } } @@ -191,13 +190,13 @@ void LocalTranslator::TranslateNetworkConfiguration() { // Set the type except for Ethernet which is set in TranslateEthernet. if (type != network_type::kEthernet) - TranslateWithTableAndSet(type, kNetworkTypeTable, flimflam::kTypeProperty); + TranslateWithTableAndSet(type, kNetworkTypeTable, shill::kTypeProperty); // Shill doesn't allow setting the name for non-VPN networks. if (type == network_type::kVPN) { std::string name; onc_object_->GetStringWithoutPathExpansion(network_config::kName, &name); - shill_dictionary_->SetStringWithoutPathExpansion(flimflam::kNameProperty, + shill_dictionary_->SetStringWithoutPathExpansion(shill::kNameProperty, name); } diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc index 3835e6b..124db9f 100644 --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc @@ -128,7 +128,7 @@ ShillToONCTranslator::CreateTranslatedONCObject() { void ShillToONCTranslator::TranslateEthernet() { std::string shill_network_type; - shill_dictionary_->GetStringWithoutPathExpansion(flimflam::kTypeProperty, + shill_dictionary_->GetStringWithoutPathExpansion(shill::kTypeProperty, &shill_network_type); const char* onc_auth = ethernet::kNone; if (shill_network_type == shill::kTypeEthernetEap) @@ -142,7 +142,7 @@ void ShillToONCTranslator::TranslateOpenVPN() { // wraps the value into a list. std::string certKU; if (shill_dictionary_->GetStringWithoutPathExpansion( - flimflam::kOpenVPNRemoteCertKUProperty, &certKU)) { + shill::kOpenVPNRemoteCertKUProperty, &certKU)) { scoped_ptr<base::ListValue> certKUs(new base::ListValue); certKUs->AppendString(certKU); onc_object_->SetWithoutPathExpansion(openvpn::kRemoteCertKU, @@ -197,7 +197,7 @@ void ShillToONCTranslator::TranslateOpenVPN() { } void ShillToONCTranslator::TranslateVPN() { - TranslateWithTableAndSet(flimflam::kProviderTypeProperty, kVPNTypeTable, + TranslateWithTableAndSet(shill::kProviderTypeProperty, kVPNTypeTable, vpn::kType); CopyPropertiesAccordingToSignature(); @@ -214,7 +214,7 @@ void ShillToONCTranslator::TranslateVPN() { } void ShillToONCTranslator::TranslateWiFiWithState() { - TranslateWithTableAndSet(flimflam::kSecurityProperty, kWiFiSecurityTable, + TranslateWithTableAndSet(shill::kSecurityProperty, kWiFiSecurityTable, wifi::kSecurity); CopyPropertiesAccordingToSignature(); } @@ -223,11 +223,11 @@ void ShillToONCTranslator::TranslateCellularWithState() { CopyPropertiesAccordingToSignature(); const base::DictionaryValue* dictionary = NULL; if (shill_dictionary_->GetDictionaryWithoutPathExpansion( - flimflam::kServingOperatorProperty, &dictionary)) { + shill::kServingOperatorProperty, &dictionary)) { TranslateAndAddNestedObject(cellular::kServingOperator, *dictionary); } if (shill_dictionary_->GetDictionaryWithoutPathExpansion( - flimflam::kCellularApnProperty, &dictionary)) { + shill::kCellularApnProperty, &dictionary)) { TranslateAndAddNestedObject(cellular::kAPN, *dictionary); } } @@ -236,10 +236,10 @@ void ShillToONCTranslator::TranslateNetworkWithState() { CopyPropertiesAccordingToSignature(); std::string shill_network_type; - shill_dictionary_->GetStringWithoutPathExpansion(flimflam::kTypeProperty, + shill_dictionary_->GetStringWithoutPathExpansion(shill::kTypeProperty, &shill_network_type); std::string onc_network_type = network_type::kEthernet; - if (shill_network_type != flimflam::kTypeEthernet && + if (shill_network_type != shill::kTypeEthernet && shill_network_type != shill::kTypeEthernetEap) { TranslateStringToONC( kNetworkTypeTable, shill_network_type, &onc_network_type); @@ -253,12 +253,12 @@ void ShillToONCTranslator::TranslateNetworkWithState() { // Since Name is a read only field in Shill unless it's a VPN, it is copied // here, but not when going the other direction (if it's not a VPN). std::string name; - shill_dictionary_->GetStringWithoutPathExpansion(flimflam::kNameProperty, + shill_dictionary_->GetStringWithoutPathExpansion(shill::kNameProperty, &name); onc_object_->SetStringWithoutPathExpansion(network_config::kName, name); std::string state; - if (shill_dictionary_->GetStringWithoutPathExpansion(flimflam::kStateProperty, + if (shill_dictionary_->GetStringWithoutPathExpansion(shill::kStateProperty, &state)) { std::string onc_state = connection_state::kNotConnected; if (NetworkState::StateIsConnected(state)) { diff --git a/chromeos/network/policy_applicator.cc b/chromeos/network/policy_applicator.cc index 33fa703..bc2315d 100644 --- a/chromeos/network/policy_applicator.cc +++ b/chromeos/network/policy_applicator.cc @@ -73,10 +73,10 @@ void PolicyApplicator::GetProfilePropertiesCallback( VLOG(2) << "Received properties for profile " << profile_.ToDebugString(); const base::ListValue* entries = NULL; if (!profile_properties.GetListWithoutPathExpansion( - flimflam::kEntriesProperty, &entries)) { + shill::kEntriesProperty, &entries)) { LOG(ERROR) << "Profile " << profile_.ToDebugString() << " doesn't contain the property " - << flimflam::kEntriesProperty; + << shill::kEntriesProperty; return; } diff --git a/chromeos/network/policy_util.cc b/chromeos/network/policy_util.cc index c05d067..086a83a 100644 --- a/chromeos/network/policy_util.cc +++ b/chromeos/network/policy_util.cc @@ -154,7 +154,7 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration( onc::TranslateONCObjectToShill(&onc::kNetworkConfigurationSignature, *effective)); - shill_dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, + shill_dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty, profile.path); scoped_ptr<NetworkUIData> ui_data; diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc index bd47b20..4d2604e 100644 --- a/chromeos/network/shill_property_handler.cc +++ b/chromeos/network/shill_property_handler.cc @@ -173,7 +173,7 @@ void ShillPropertyHandler::SetCheckPortalList( const std::string& check_portal_list) { base::StringValue value(check_portal_list); shill_manager_->SetProperty( - flimflam::kCheckPortalListProperty, + shill::kCheckPortalListProperty, value, base::Bind(&base::DoNothing), base::Bind(&network_handler::ShillErrorCallbackFunction, @@ -245,7 +245,7 @@ void ShillPropertyHandler::ManagerPropertiesCallback( for (base::DictionaryValue::Iterator iter(properties); !iter.IsAtEnd(); iter.Advance()) { // Defer updating Services until all other properties have been updated. - if (iter.key() == flimflam::kServicesProperty) + if (iter.key() == shill::kServicesProperty) update_service_value = &iter.value(); else if (iter.key() == shill::kServiceCompleteListProperty) update_service_complete_value = &iter.value(); @@ -254,7 +254,7 @@ void ShillPropertyHandler::ManagerPropertiesCallback( } // Update Services which can safely assume other properties have been set. if (update_service_value) - ManagerPropertyChanged(flimflam::kServicesProperty, *update_service_value); + ManagerPropertyChanged(shill::kServicesProperty, *update_service_value); // Update ServiceCompleteList which skips entries that have already been // requested for Services. if (update_service_complete_value) { @@ -268,7 +268,7 @@ void ShillPropertyHandler::ManagerPropertiesCallback( void ShillPropertyHandler::CheckPendingStateListUpdates( const std::string& key) { // Once there are no pending updates, signal the state list changed callbacks. - if ((key.empty() || key == flimflam::kServicesProperty) && + if ((key.empty() || key == shill::kServicesProperty) && pending_updates_[ManagedState::MANAGED_TYPE_NETWORK].size() == 0) { listener_->ManagedStateListChanged(ManagedState::MANAGED_TYPE_NETWORK); } @@ -279,7 +279,7 @@ void ShillPropertyHandler::CheckPendingStateListUpdates( pending_updates_[ManagedState::MANAGED_TYPE_FAVORITE].size() == 0) { listener_->ManagedStateListChanged(ManagedState::MANAGED_TYPE_FAVORITE); } - if ((key.empty() || key == flimflam::kDevicesProperty) && + if ((key.empty() || key == shill::kDevicesProperty) && pending_updates_[ManagedState::MANAGED_TYPE_DEVICE].size() == 0) { listener_->ManagedStateListChanged(ManagedState::MANAGED_TYPE_DEVICE); } @@ -287,7 +287,7 @@ void ShillPropertyHandler::CheckPendingStateListUpdates( void ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, const base::Value& value) { - if (key == flimflam::kServicesProperty) { + if (key == shill::kServicesProperty) { const base::ListValue* vlist = GetListValue(key, value); if (vlist) { listener_->UpdateManagedList(ManagedState::MANAGED_TYPE_NETWORK, *vlist); @@ -304,18 +304,18 @@ void ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, listener_->UpdateManagedList(ManagedState::MANAGED_TYPE_FAVORITE, *vlist); UpdateProperties(ManagedState::MANAGED_TYPE_FAVORITE, *vlist); } - } else if (key == flimflam::kDevicesProperty) { + } else if (key == shill::kDevicesProperty) { const base::ListValue* vlist = GetListValue(key, value); if (vlist) { listener_->UpdateManagedList(ManagedState::MANAGED_TYPE_DEVICE, *vlist); UpdateProperties(ManagedState::MANAGED_TYPE_DEVICE, *vlist); UpdateObserved(ManagedState::MANAGED_TYPE_DEVICE, *vlist); } - } else if (key == flimflam::kAvailableTechnologiesProperty) { + } else if (key == shill::kAvailableTechnologiesProperty) { const base::ListValue* vlist = GetListValue(key, value); if (vlist) UpdateAvailableTechnologies(*vlist); - } else if (key == flimflam::kEnabledTechnologiesProperty) { + } else if (key == shill::kEnabledTechnologiesProperty) { const base::ListValue* vlist = GetListValue(key, value); if (vlist) UpdateEnabledTechnologies(*vlist); @@ -323,9 +323,9 @@ void ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, const base::ListValue* vlist = GetListValue(key, value); if (vlist) UpdateUninitializedTechnologies(*vlist); - } else if (key == flimflam::kProfilesProperty) { + } else if (key == shill::kProfilesProperty) { listener_->ProfileListChanged(); - } else if (key == flimflam::kCheckPortalListProperty) { + } else if (key == shill::kCheckPortalListProperty) { std::string check_portal_list; if (value.GetAsString(&check_portal_list)) listener_->CheckPortalListChanged(check_portal_list); @@ -471,7 +471,7 @@ void ShillPropertyHandler::GetPropertiesCallback( // Only networks with a ProfilePath set are Favorites. std::string profile_path; properties.GetStringWithoutPathExpansion( - flimflam::kProfileProperty, &profile_path); + shill::kProfileProperty, &profile_path); if (!profile_path.empty()) { listener_->UpdateManagedStateProperties( ManagedState::MANAGED_TYPE_FAVORITE, path, properties); @@ -543,14 +543,10 @@ void ShillPropertyHandler::GetIPConfigCallback( service_path.c_str(), call_status)); return; } - UpdateIPConfigProperty(service_path, properties, - flimflam::kAddressProperty); - UpdateIPConfigProperty(service_path, properties, - flimflam::kNameServersProperty); - UpdateIPConfigProperty(service_path, properties, - flimflam::kPrefixlenProperty); - UpdateIPConfigProperty(service_path, properties, - flimflam::kGatewayProperty); + UpdateIPConfigProperty(service_path, properties, shill::kAddressProperty); + UpdateIPConfigProperty(service_path, properties, shill::kNameServersProperty); + UpdateIPConfigProperty(service_path, properties, shill::kPrefixlenProperty); + UpdateIPConfigProperty(service_path, properties, shill::kGatewayProperty); UpdateIPConfigProperty(service_path, properties, shill::kWebProxyAutoDiscoveryUrlProperty); } diff --git a/chromeos/network/shill_property_handler_unittest.cc b/chromeos/network/shill_property_handler_unittest.cc index 571230f..431cccf 100644 --- a/chromeos/network/shill_property_handler_unittest.cc +++ b/chromeos/network/shill_property_handler_unittest.cc @@ -59,14 +59,14 @@ class TestListener : public internal::ShillPropertyHandler::Listener { const std::string& service_path, const std::string& key, const base::Value& value) OVERRIDE { - AddPropertyUpdate(flimflam::kServicesProperty, service_path); + AddPropertyUpdate(shill::kServicesProperty, service_path); } virtual void UpdateDeviceProperty( const std::string& device_path, const std::string& key, const base::Value& value) OVERRIDE { - AddPropertyUpdate(flimflam::kDevicesProperty, device_path); + AddPropertyUpdate(shill::kDevicesProperty, device_path); } virtual void TechnologyListChanged() OVERRIDE { @@ -99,11 +99,11 @@ class TestListener : public internal::ShillPropertyHandler::Listener { private: std::string GetTypeString(ManagedState::ManagedType type) { if (type == ManagedState::MANAGED_TYPE_NETWORK) { - return flimflam::kServicesProperty; + return shill::kServicesProperty; } else if (type == ManagedState::MANAGED_TYPE_FAVORITE) { return shill::kServiceCompleteListProperty; } else if (type == ManagedState::MANAGED_TYPE_DEVICE) { - return flimflam::kDevicesProperty; + return shill::kDevicesProperty; } LOG(ERROR) << "UpdateManagedList called with unrecognized type: " << type; ++errors_; @@ -225,7 +225,7 @@ class ShillPropertyHandlerTest : public testing::Test { void AddServiceToProfile(const std::string& type, const std::string& id, bool visible) { - service_test_->AddService(id, id, type, flimflam::kStateIdle, + service_test_->AddService(id, id, type, shill::kStateIdle, visible, false /* watch */); std::vector<std::string> profiles; profile_test_->GetProfilePaths(&profiles); @@ -248,31 +248,31 @@ class ShillPropertyHandlerTest : public testing::Test { } bool IsValidType(const std::string& type) { - return (type == flimflam::kTypeEthernet || + return (type == shill::kTypeEthernet || type == shill::kTypeEthernetEap || - type == flimflam::kTypeWifi || - type == flimflam::kTypeWimax || - type == flimflam::kTypeBluetooth || - type == flimflam::kTypeCellular || - type == flimflam::kTypeVPN); + type == shill::kTypeWifi || + type == shill::kTypeWimax || + type == shill::kTypeBluetooth || + type == shill::kTypeCellular || + type == shill::kTypeVPN); } protected: void SetupDefaultShillState() { message_loop_.RunUntilIdle(); // Process any pending updates device_test_->ClearDevices(); - AddDevice(flimflam::kTypeWifi, "stub_wifi_device1"); - AddDevice(flimflam::kTypeCellular, "stub_cellular_device1"); + AddDevice(shill::kTypeWifi, "stub_wifi_device1"); + AddDevice(shill::kTypeCellular, "stub_cellular_device1"); service_test_->ClearServices(); const bool add_to_watchlist = true; - AddService(flimflam::kTypeEthernet, "stub_ethernet", - flimflam::kStateOnline, add_to_watchlist); - AddService(flimflam::kTypeWifi, "stub_wifi1", - flimflam::kStateOnline, add_to_watchlist); - AddService(flimflam::kTypeWifi, "stub_wifi2", - flimflam::kStateIdle, add_to_watchlist); - AddService(flimflam::kTypeCellular, "stub_cellular1", - flimflam::kStateIdle, add_to_watchlist); + AddService(shill::kTypeEthernet, "stub_ethernet", + shill::kStateOnline, add_to_watchlist); + AddService(shill::kTypeWifi, "stub_wifi1", + shill::kStateOnline, add_to_watchlist); + AddService(shill::kTypeWifi, "stub_wifi2", + shill::kStateIdle, add_to_watchlist); + AddService(shill::kTypeCellular, "stub_cellular1", + shill::kStateIdle, add_to_watchlist); } base::MessageLoopForUI message_loop_; @@ -288,16 +288,14 @@ class ShillPropertyHandlerTest : public testing::Test { }; TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerStub) { - EXPECT_TRUE(shill_property_handler_->IsTechnologyAvailable( - flimflam::kTypeWifi)); - EXPECT_TRUE(shill_property_handler_->IsTechnologyEnabled( - flimflam::kTypeWifi)); + EXPECT_TRUE(shill_property_handler_->IsTechnologyAvailable(shill::kTypeWifi)); + EXPECT_TRUE(shill_property_handler_->IsTechnologyEnabled(shill::kTypeWifi)); const size_t kNumShillManagerClientStubImplDevices = 2; EXPECT_EQ(kNumShillManagerClientStubImplDevices, - listener_->entries(flimflam::kDevicesProperty).size()); + listener_->entries(shill::kDevicesProperty).size()); const size_t kNumShillManagerClientStubImplServices = 4; EXPECT_EQ(kNumShillManagerClientStubImplServices, - listener_->entries(flimflam::kServicesProperty).size()); + listener_->entries(shill::kServicesProperty).size()); EXPECT_EQ(0, listener_->errors()); } @@ -307,114 +305,110 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerTechnologyChanged) { EXPECT_EQ(initial_technology_updates, listener_->technology_list_updates()); // Remove a technology. Updates both the Available and Enabled lists. - manager_test_->RemoveTechnology(flimflam::kTypeWimax); + manager_test_->RemoveTechnology(shill::kTypeWimax); message_loop_.RunUntilIdle(); EXPECT_EQ(initial_technology_updates + 2, listener_->technology_list_updates()); // Add a disabled technology. - manager_test_->AddTechnology(flimflam::kTypeWimax, false); + manager_test_->AddTechnology(shill::kTypeWimax, false); message_loop_.RunUntilIdle(); EXPECT_EQ(initial_technology_updates + 3, listener_->technology_list_updates()); EXPECT_TRUE(shill_property_handler_->IsTechnologyAvailable( - flimflam::kTypeWimax)); - EXPECT_FALSE(shill_property_handler_->IsTechnologyEnabled( - flimflam::kTypeWimax)); + shill::kTypeWimax)); + EXPECT_FALSE(shill_property_handler_->IsTechnologyEnabled(shill::kTypeWimax)); // Enable the technology. DBusThreadManager::Get()->GetShillManagerClient()->EnableTechnology( - flimflam::kTypeWimax, + shill::kTypeWimax, base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); EXPECT_EQ(initial_technology_updates + 4, listener_->technology_list_updates()); - EXPECT_TRUE(shill_property_handler_->IsTechnologyEnabled( - flimflam::kTypeWimax)); + EXPECT_TRUE(shill_property_handler_->IsTechnologyEnabled(shill::kTypeWimax)); EXPECT_EQ(0, listener_->errors()); } TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerDevicePropertyChanged) { - EXPECT_EQ(1, listener_->list_updates(flimflam::kDevicesProperty)); + EXPECT_EQ(1, listener_->list_updates(shill::kDevicesProperty)); const size_t kNumShillManagerClientStubImplDevices = 2; EXPECT_EQ(kNumShillManagerClientStubImplDevices, - listener_->entries(flimflam::kDevicesProperty).size()); + listener_->entries(shill::kDevicesProperty).size()); // Add a device. const std::string kTestDevicePath("test_wifi_device1"); - AddDevice(flimflam::kTypeWifi, kTestDevicePath); + AddDevice(shill::kTypeWifi, kTestDevicePath); message_loop_.RunUntilIdle(); - EXPECT_EQ(2, listener_->list_updates(flimflam::kDevicesProperty)); + EXPECT_EQ(2, listener_->list_updates(shill::kDevicesProperty)); EXPECT_EQ(kNumShillManagerClientStubImplDevices + 1, - listener_->entries(flimflam::kDevicesProperty).size()); + listener_->entries(shill::kDevicesProperty).size()); // Device changes are not observed. // Remove a device RemoveDevice(kTestDevicePath); message_loop_.RunUntilIdle(); - EXPECT_EQ(3, listener_->list_updates(flimflam::kDevicesProperty)); + EXPECT_EQ(3, listener_->list_updates(shill::kDevicesProperty)); EXPECT_EQ(kNumShillManagerClientStubImplDevices, - listener_->entries(flimflam::kDevicesProperty).size()); + listener_->entries(shill::kDevicesProperty).size()); EXPECT_EQ(0, listener_->errors()); } TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) { - EXPECT_EQ(1, listener_->list_updates(flimflam::kServicesProperty)); + EXPECT_EQ(1, listener_->list_updates(shill::kServicesProperty)); const size_t kNumShillManagerClientStubImplServices = 4; EXPECT_EQ(kNumShillManagerClientStubImplServices, - listener_->entries(flimflam::kServicesProperty).size()); + listener_->entries(shill::kServicesProperty).size()); // Add an unwatched service. const std::string kTestServicePath("test_wifi_service1"); - AddService(flimflam::kTypeWifi, kTestServicePath, - flimflam::kStateIdle, false); + AddService(shill::kTypeWifi, kTestServicePath, shill::kStateIdle, false); message_loop_.RunUntilIdle(); // Watched and unwatched services trigger a service list update. - EXPECT_EQ(2, listener_->list_updates(flimflam::kServicesProperty)); + EXPECT_EQ(2, listener_->list_updates(shill::kServicesProperty)); EXPECT_EQ(kNumShillManagerClientStubImplServices + 1, - listener_->entries(flimflam::kServicesProperty).size()); + listener_->entries(shill::kServicesProperty).size()); // Service receives an initial property update. EXPECT_EQ(1, listener_->initial_property_updates( - flimflam::kServicesProperty)[kTestServicePath]); + shill::kServicesProperty)[kTestServicePath]); // Change a property. base::FundamentalValue scan_interval(3); DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(kTestServicePath), - flimflam::kScanIntervalProperty, + shill::kScanIntervalProperty, scan_interval, base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); // Property change triggers an update. EXPECT_EQ(1, listener_->property_updates( - flimflam::kServicesProperty)[kTestServicePath]); + shill::kServicesProperty)[kTestServicePath]); // Add the existing service to the watch list. - AddService(flimflam::kTypeWifi, kTestServicePath, - flimflam::kStateIdle, true); + AddService(shill::kTypeWifi, kTestServicePath, shill::kStateIdle, true); message_loop_.RunUntilIdle(); // Service list update should be received when watch list changes. - EXPECT_EQ(2, listener_->list_updates(flimflam::kServicesProperty)); + EXPECT_EQ(2, listener_->list_updates(shill::kServicesProperty)); // Number of services shouldn't change. EXPECT_EQ(kNumShillManagerClientStubImplServices + 1, - listener_->entries(flimflam::kServicesProperty).size()); + listener_->entries(shill::kServicesProperty).size()); // Change a property. DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(kTestServicePath), - flimflam::kScanIntervalProperty, + shill::kScanIntervalProperty, scan_interval, base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); // Property change should trigger another update. EXPECT_EQ(2, listener_->property_updates( - flimflam::kServicesProperty)[kTestServicePath]); + shill::kServicesProperty)[kTestServicePath]); // Remove a service RemoveService(kTestServicePath); message_loop_.RunUntilIdle(); - EXPECT_EQ(3, listener_->list_updates(flimflam::kServicesProperty)); + EXPECT_EQ(3, listener_->list_updates(shill::kServicesProperty)); EXPECT_EQ(kNumShillManagerClientStubImplServices, - listener_->entries(flimflam::kServicesProperty).size()); + listener_->entries(shill::kServicesProperty).size()); EXPECT_EQ(0, listener_->errors()); } @@ -426,36 +420,35 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerIPConfigPropertyChanged) { base::StringValue ip_address("192.168.1.1"); DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( dbus::ObjectPath(kTestIPConfigPath), - flimflam::kAddressProperty, ip_address, + shill::kAddressProperty, ip_address, base::Bind(&DoNothingWithCallStatus)); base::ListValue dns_servers; dns_servers.Append(base::Value::CreateStringValue("192.168.1.100")); dns_servers.Append(base::Value::CreateStringValue("192.168.1.101")); DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( dbus::ObjectPath(kTestIPConfigPath), - flimflam::kNameServersProperty, dns_servers, + shill::kNameServersProperty, dns_servers, base::Bind(&DoNothingWithCallStatus)); base::FundamentalValue prefixlen(8); DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( dbus::ObjectPath(kTestIPConfigPath), - flimflam::kPrefixlenProperty, prefixlen, + shill::kPrefixlenProperty, prefixlen, base::Bind(&DoNothingWithCallStatus)); base::StringValue gateway("192.0.0.1"); DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( dbus::ObjectPath(kTestIPConfigPath), - flimflam::kGatewayProperty, gateway, + shill::kGatewayProperty, gateway, base::Bind(&DoNothingWithCallStatus)); message_loop_.RunUntilIdle(); // Add a service with an empty ipconfig and then update // its ipconfig property. const std::string kTestServicePath1("test_wifi_service1"); - AddService(flimflam::kTypeWifi, kTestServicePath1, - flimflam::kStateIdle, true); + AddService(shill::kTypeWifi, kTestServicePath1, shill::kStateIdle, true); message_loop_.RunUntilIdle(); // This is the initial property update. EXPECT_EQ(1, listener_->initial_property_updates( - flimflam::kServicesProperty)[kTestServicePath1]); + shill::kServicesProperty)[kTestServicePath1]); DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(kTestServicePath1), shill::kIPConfigProperty, @@ -465,39 +458,39 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerIPConfigPropertyChanged) { // IPConfig property change on the service should trigger property updates for // IP Address, DNS, prefixlen, and gateway. EXPECT_EQ(4, listener_->property_updates( - flimflam::kServicesProperty)[kTestServicePath1]); + shill::kServicesProperty)[kTestServicePath1]); // Now, Add a new watched service with the IPConfig already set. const std::string kTestServicePath2("test_wifi_service2"); - AddServiceWithIPConfig(flimflam::kTypeWifi, kTestServicePath2, - flimflam::kStateIdle, kTestIPConfigPath, true); + AddServiceWithIPConfig(shill::kTypeWifi, kTestServicePath2, + shill::kStateIdle, kTestIPConfigPath, true); message_loop_.RunUntilIdle(); // A watched service with the IPConfig property already set must trigger // property updates for IP Address, DNS, prefixlen, and gateway when added. EXPECT_EQ(4, listener_->property_updates( - flimflam::kServicesProperty)[kTestServicePath2]); + shill::kServicesProperty)[kTestServicePath2]); } TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServiceCompleteList) { // Initial list updates. - EXPECT_EQ(1, listener_->list_updates(flimflam::kServicesProperty)); + EXPECT_EQ(1, listener_->list_updates(shill::kServicesProperty)); EXPECT_EQ(1, listener_->list_updates(shill::kServiceCompleteListProperty)); // Add a new entry to the profile only; should trigger a single list update // for both Services and ServiceCompleteList, and a single property update // for ServiceCompleteList. const std::string kTestServicePath1("stub_wifi_profile_only1"); - AddServiceToProfile(flimflam::kTypeWifi, kTestServicePath1, false); + AddServiceToProfile(shill::kTypeWifi, kTestServicePath1, false); shill_property_handler_->UpdateManagerProperties(); message_loop_.RunUntilIdle(); - EXPECT_EQ(2, listener_->list_updates(flimflam::kServicesProperty)); + EXPECT_EQ(2, listener_->list_updates(shill::kServicesProperty)); EXPECT_EQ(2, listener_->list_updates(shill::kServiceCompleteListProperty)); EXPECT_EQ(0, listener_->initial_property_updates( - flimflam::kServicesProperty)[kTestServicePath1]); + shill::kServicesProperty)[kTestServicePath1]); EXPECT_EQ(1, listener_->initial_property_updates( shill::kServiceCompleteListProperty)[kTestServicePath1]); EXPECT_EQ(0, listener_->property_updates( - flimflam::kServicesProperty)[kTestServicePath1]); + shill::kServicesProperty)[kTestServicePath1]); EXPECT_EQ(0, listener_->property_updates( shill::kServiceCompleteListProperty)[kTestServicePath1]); @@ -507,18 +500,18 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServiceCompleteList) { // changes, and one for the Request) and one ServiceCompleteList change for // the Request. const std::string kTestServicePath2("stub_wifi_profile_only2"); - AddServiceToProfile(flimflam::kTypeWifi, kTestServicePath2, true); + AddServiceToProfile(shill::kTypeWifi, kTestServicePath2, true); shill_property_handler_->UpdateManagerProperties(); message_loop_.RunUntilIdle(); - EXPECT_EQ(3, listener_->list_updates(flimflam::kServicesProperty)); + EXPECT_EQ(3, listener_->list_updates(shill::kServicesProperty)); EXPECT_EQ(3, listener_->list_updates(shill::kServiceCompleteListProperty)); EXPECT_EQ(1, listener_->initial_property_updates( - flimflam::kServicesProperty)[kTestServicePath2]); + shill::kServicesProperty)[kTestServicePath2]); EXPECT_EQ(1, listener_->initial_property_updates( shill::kServiceCompleteListProperty)[kTestServicePath2]); // Expect one property update for the Profile property of the Network. EXPECT_EQ(1, listener_->property_updates( - flimflam::kServicesProperty)[kTestServicePath2]); + shill::kServicesProperty)[kTestServicePath2]); EXPECT_EQ(0, listener_->property_updates( shill::kServiceCompleteListProperty)[kTestServicePath2]); @@ -526,14 +519,14 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServiceCompleteList) { base::FundamentalValue scan_interval(3); DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(kTestServicePath2), - flimflam::kScanIntervalProperty, + shill::kScanIntervalProperty, scan_interval, base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); // Property change should trigger an update for the Network only; no // property updates pushed by Shill affect Favorites. EXPECT_EQ(2, listener_->property_updates( - flimflam::kServicesProperty)[kTestServicePath2]); + shill::kServicesProperty)[kTestServicePath2]); EXPECT_EQ(0, listener_->property_updates( shill::kServiceCompleteListProperty)[kTestServicePath2]); } 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) { diff --git a/chromeos/network/shill_property_util.h b/chromeos/network/shill_property_util.h index e8485ba..9072a28 100644 --- a/chromeos/network/shill_property_util.h +++ b/chromeos/network/shill_property_util.h @@ -75,7 +75,7 @@ class CHROMEOS_EXPORT NetworkTypePattern { // Matches only networks of exactly the type |shill_network_type|, which must // be one of the types defined in service_constants.h (e.g. - // flimflam::kTypeWifi). + // shill::kTypeWifi). // Note: Shill distinguishes Ethernet without EAP from Ethernet with EAP. If // unsure, better use one of the matchers above. static NetworkTypePattern Primitive(const std::string& shill_network_type); diff --git a/chromeos/network/shill_property_util_unittest.cc b/chromeos/network/shill_property_util_unittest.cc index ffbefe3..2d8b764 100644 --- a/chromeos/network/shill_property_util_unittest.cc +++ b/chromeos/network/shill_property_util_unittest.cc @@ -42,14 +42,14 @@ class NetworkTypePatternTest : public testing::Test { } // namespace TEST_F(NetworkTypePatternTest, MatchesType) { - EXPECT_TRUE(mobile_.MatchesType(flimflam::kTypeCellular)); - EXPECT_TRUE(mobile_.MatchesType(flimflam::kTypeWimax)); - EXPECT_FALSE(mobile_.MatchesType(flimflam::kTypeWifi)); - - EXPECT_TRUE(wireless_.MatchesType(flimflam::kTypeWifi)); - EXPECT_TRUE(wireless_.MatchesType(flimflam::kTypeCellular)); - EXPECT_TRUE(wireless_.MatchesType(flimflam::kTypeWimax)); - EXPECT_FALSE(wireless_.MatchesType(flimflam::kTypeEthernet)); + EXPECT_TRUE(mobile_.MatchesType(shill::kTypeCellular)); + EXPECT_TRUE(mobile_.MatchesType(shill::kTypeWimax)); + EXPECT_FALSE(mobile_.MatchesType(shill::kTypeWifi)); + + EXPECT_TRUE(wireless_.MatchesType(shill::kTypeWifi)); + EXPECT_TRUE(wireless_.MatchesType(shill::kTypeCellular)); + EXPECT_TRUE(wireless_.MatchesType(shill::kTypeWimax)); + EXPECT_FALSE(wireless_.MatchesType(shill::kTypeEthernet)); } TEST_F(NetworkTypePatternTest, MatchesPattern) { @@ -83,12 +83,12 @@ TEST_F(NetworkTypePatternTest, Equals) { TEST_F(NetworkTypePatternTest, Primitive) { const NetworkTypePattern primitive_cellular = - NetworkTypePattern::Primitive(flimflam::kTypeCellular); + NetworkTypePattern::Primitive(shill::kTypeCellular); EXPECT_TRUE(cellular_.Equals(primitive_cellular)); EXPECT_TRUE(primitive_cellular.Equals(cellular_)); const NetworkTypePattern primitive_wimax = - NetworkTypePattern::Primitive(flimflam::kTypeWimax); + NetworkTypePattern::Primitive(shill::kTypeWimax); EXPECT_TRUE(wimax_.Equals(primitive_wimax)); EXPECT_TRUE(primitive_wimax.Equals(wimax_)); } |