| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/options/wifi_config_view.h" | 5 #include "chrome/browser/chromeos/options/wifi_config_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 bool WifiConfigView::HaveUserCerts() const { | 437 bool WifiConfigView::HaveUserCerts() const { |
| 438 return CertLibrary::Get()->NumCertificates(CertLibrary::CERT_TYPE_USER) > 0; | 438 return CertLibrary::Get()->NumCertificates(CertLibrary::CERT_TYPE_USER) > 0; |
| 439 } | 439 } |
| 440 | 440 |
| 441 bool WifiConfigView::IsUserCertValid() const { | 441 bool WifiConfigView::IsUserCertValid() const { |
| 442 if (!UserCertActive()) | 442 if (!UserCertActive()) |
| 443 return false; | 443 return false; |
| 444 int index = user_cert_combobox_->selected_index(); | 444 int index = user_cert_combobox_->selected_index(); |
| 445 if (index < 0) | 445 if (index < 0) |
| 446 return false; | 446 return false; |
| 447 // Currently only hardware-backed user certificates are valid. | 447 // Make sure the certificate is hardware-backed if the hardware supports it. |
| 448 if (!CertLibrary::Get()->IsCertHardwareBackedAt(CertLibrary::CERT_TYPE_USER, | 448 if (!CertLibrary::Get()->IsCertSecureAt(CertLibrary::CERT_TYPE_USER, index)) { |
| 449 index)) { | |
| 450 return false; | 449 return false; |
| 451 } | 450 } |
| 452 return true; | 451 return true; |
| 453 } | 452 } |
| 454 | 453 |
| 455 bool WifiConfigView::Phase2AuthActive() const { | 454 bool WifiConfigView::Phase2AuthActive() const { |
| 456 if (phase_2_auth_combobox_) | 455 if (phase_2_auth_combobox_) |
| 457 return phase_2_auth_combobox_->model()->GetItemCount() > 1; | 456 return phase_2_auth_combobox_->model()->GetItemCount() > 1; |
| 458 return false; | 457 return false; |
| 459 } | 458 } |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 void WifiConfigView::ParseEAPUIProperty(NetworkPropertyUIData* property_ui_data, | 1383 void WifiConfigView::ParseEAPUIProperty(NetworkPropertyUIData* property_ui_data, |
| 1385 const NetworkState* network, | 1384 const NetworkState* network, |
| 1386 const std::string& key) { | 1385 const std::string& key) { |
| 1387 std::string onc_tag = network->type() == shill::kTypeEthernet | 1386 std::string onc_tag = network->type() == shill::kTypeEthernet |
| 1388 ? ::onc::ethernet::kEAP | 1387 ? ::onc::ethernet::kEAP |
| 1389 : ::onc::wifi::kEAP; | 1388 : ::onc::wifi::kEAP; |
| 1390 ParseUIProperty(property_ui_data, network, onc_tag + '.' + key); | 1389 ParseUIProperty(property_ui_data, network, onc_tag + '.' + key); |
| 1391 } | 1390 } |
| 1392 | 1391 |
| 1393 } // namespace chromeos | 1392 } // namespace chromeos |
| OLD | NEW |