Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3026)

Unified Diff: chrome/browser/chromeos/options/wifi_config_view.cc

Issue 3678006: Implement action interface in network_menu.js for 'connect'. (Closed)
Patch Set: Set status for non connected networks. Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698