Index: chrome/browser/chromeos/options/wifi_config_view.cc |
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc |
index 4df5d393eeb7b6c8a09b6fdd5a75fd9ad680bc04..51780894061b5a45677cd03aee8b1332ffc9cb63 100644 |
--- a/chrome/browser/chromeos/options/wifi_config_view.cc |
+++ b/chrome/browser/chromeos/options/wifi_config_view.cc |
@@ -195,23 +195,6 @@ void WifiConfigView::FocusFirstField() { |
passphrase_textfield_->RequestFocus(); |
} |
-// Parse 'path' to determine if the certificate is stored in a pkcs#11 device. |
-// flimflam recognizes the string "SETTINGS:" to specify authentication |
-// parameters. 'key_id=' indicates that the certificate is stored in a pkcs#11 |
-// device. See src/third_party/flimflam/files/doc/service-api.txt. |
-static bool is_certificate_in_pkcs11(const std::string& path) { |
- static const std::string settings_string("SETTINGS:"); |
- static const std::string pkcs11_key("key_id"); |
- if (path.find(settings_string) == 0) { |
- std::string::size_type idx = path.find(pkcs11_key); |
- if (idx != std::string::npos) |
- idx = path.find_first_not_of(kWhitespaceASCII, idx + pkcs11_key.length()); |
- if (idx != std::string::npos && path[idx] == '=') |
- return true; |
- } |
- return false; |
-} |
- |
void WifiConfigView::Init() { |
views::GridLayout* layout = CreatePanelGridLayout(this); |
SetLayoutManager(layout); |
@@ -242,9 +225,9 @@ void WifiConfigView::Init() { |
} |
layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
- // Certificates stored in a pkcs11 device can not be browsed |
- // and do not require a passphrase. |
- bool certificate_in_pkcs11 = false; |
+ // Loaded certificates (i.e. stored in a pkcs11 device) do not require |
+ // a passphrase. |
+ bool certificate_loaded = false; |
// Add ID and cert password if we're using 802.1x |
// XXX we're cheating and assuming 802.1x means EAP-TLS - not true |
@@ -267,9 +250,9 @@ void WifiConfigView::Init() { |
IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT))); |
if (!wifi_.cert_path().empty()) { |
certificate_path_ = wifi_.cert_path(); |
- certificate_in_pkcs11 = is_certificate_in_pkcs11(certificate_path_); |
+ certificate_loaded = wifi_.IsCertificateLoaded(); |
} |
- if (certificate_in_pkcs11) { |
+ if (certificate_loaded) { |
std::wstring label = l10n_util::GetString( |
IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_INSTALLED); |
views::Label* cert_text = new views::Label(label); |
@@ -289,7 +272,7 @@ void WifiConfigView::Init() { |
} |
// Add passphrase if other_network or wifi is encrypted. |
- if (other_network_ || (wifi_.encrypted() && !certificate_in_pkcs11)) { |
+ if (other_network_ || (wifi_.encrypted() && !certificate_loaded)) { |
layout->StartRow(0, column_view_set_id); |
int label_text_id; |
if (wifi_.encryption() == SECURITY_8021X) |