summaryrefslogtreecommitdiffstats
path: root/chromeos/network
diff options
context:
space:
mode:
authorstevenjb <stevenjb@chromium.org>2015-11-05 18:08:00 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-06 02:08:48 +0000
commit129ec916768c0ee459507840c72e4123817e1fbd (patch)
treef17be38484267a78ec9f7bb4c3065ac78d895f2c /chromeos/network
parentaba3cd0fad04fb412eeba2f93f1760242349bcee (diff)
downloadchromium_src-129ec916768c0ee459507840c72e4123817e1fbd.zip
chromium_src-129ec916768c0ee459507840c72e4123817e1fbd.tar.gz
chromium_src-129ec916768c0ee459507840c72e4123817e1fbd.tar.bz2
Add Dynamic WEP support to wifi config UI
BUG=551666 Review URL: https://codereview.chromium.org/1406933005 Cr-Commit-Position: refs/heads/master@{#358233}
Diffstat (limited to 'chromeos/network')
-rw-r--r--chromeos/network/network_state.cc7
-rw-r--r--chromeos/network/network_state.h4
-rw-r--r--chromeos/network/onc/onc_translator_onc_to_shill.cc5
-rw-r--r--chromeos/network/onc/onc_translator_shill_to_onc.cc5
4 files changed, 13 insertions, 8 deletions
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc
index f86902a..a71a1ce 100644
--- a/chromeos/network/network_state.cc
+++ b/chromeos/network/network_state.cc
@@ -126,6 +126,8 @@ bool NetworkState::PropertyChanged(const std::string& key,
return GetStringValue(key, value, &security_class_);
} else if (key == shill::kEapMethodProperty) {
return GetStringValue(key, value, &eap_method_);
+ } else if (key == shill::kEapKeyMgmtProperty) {
+ return GetStringValue(key, value, &eap_key_mgmt_);
} else if (key == shill::kNetworkTechnologyProperty) {
return GetStringValue(key, value, &network_technology_);
} else if (key == shill::kDeviceProperty) {
@@ -336,6 +338,11 @@ std::string NetworkState::connection_state() const {
return connection_state_;
}
+bool NetworkState::IsDynamicWep() const {
+ return security_class_ == shill::kSecurityWep &&
+ eap_key_mgmt_ == shill::kKeyManagementIEEE8021X;
+}
+
bool NetworkState::IsConnectedState() const {
return visible() && StateIsConnected(connection_state_);
}
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h
index b271ca2..d388a8e 100644
--- a/chromeos/network/network_state.h
+++ b/chromeos/network/network_state.h
@@ -99,6 +99,9 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
return third_party_vpn_provider_extension_id_;
}
+ // Returns true if the network securty is WEP_8021x (Dynamic WEP)
+ bool IsDynamicWep() const;
+
// Returns true if |connection_state_| is a connected/connecting state.
bool IsConnectedState() const;
bool IsConnectingState() const;
@@ -153,6 +156,7 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
// request properties from Shill.
std::string security_class_;
std::string eap_method_; // Needed for WiFi EAP networks
+ std::string eap_key_mgmt_; // Needed for identifying Dynamic WEP networks
std::string device_path_;
std::string guid_;
std::string connection_state_;
diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc
index 0e84300..81d0733 100644
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
@@ -29,9 +29,6 @@ namespace onc {
namespace {
-// TODO(pstew): Remove once crosreview.com/310644 lands and merges to Chrome.
-const char kKeyManagementIEEE8021X[] = "IEEE8021X";
-
scoped_ptr<base::StringValue> ConvertValueToString(const base::Value& value) {
std::string str;
if (!value.GetAsString(&str))
@@ -225,7 +222,7 @@ void LocalTranslator::TranslateWiFi() {
shill::kSecurityClassProperty);
if (security == ::onc::wifi::kWEP_8021X) {
shill_dictionary_->SetStringWithoutPathExpansion(
- shill::kEapKeyMgmtProperty, kKeyManagementIEEE8021X);
+ shill::kEapKeyMgmtProperty, shill::kKeyManagementIEEE8021X);
}
}
diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc
index e76f5e6..2861737 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -27,9 +27,6 @@ namespace onc {
namespace {
-// TODO(pstew): Remove once crosreview.com/310644 lands and merges to Chrome.
-const char kKeyManagementIEEE8021X[] = "IEEE8021X";
-
// Converts |str| to a base::Value of the given |type|. If the conversion fails,
// returns NULL.
scoped_ptr<base::Value> ConvertStringToValue(const std::string& str,
@@ -339,7 +336,7 @@ void ShillToONCTranslator::TranslateWiFiWithState() {
shill_security == shill::kSecurityWep &&
shill_dictionary_->GetStringWithoutPathExpansion(
shill::kEapKeyMgmtProperty, &shill_key_mgmt) &&
- shill_key_mgmt == kKeyManagementIEEE8021X) {
+ shill_key_mgmt == shill::kKeyManagementIEEE8021X) {
onc_object_->SetStringWithoutPathExpansion(::onc::wifi::kSecurity,
::onc::wifi::kWEP_8021X);
} else {