Chromium Code Reviews| 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/vpn_config_view.h" | 5 #include "chrome/browser/chromeos/options/vpn_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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1022 bool VPNConfigView::HaveUserCerts() const { | 1022 bool VPNConfigView::HaveUserCerts() const { |
| 1023 return CertLibrary::Get()->NumCertificates(CertLibrary::CERT_TYPE_USER) > 0; | 1023 return CertLibrary::Get()->NumCertificates(CertLibrary::CERT_TYPE_USER) > 0; |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 bool VPNConfigView::IsUserCertValid() const { | 1026 bool VPNConfigView::IsUserCertValid() const { |
| 1027 if (!user_cert_combobox_ || !enable_user_cert_) | 1027 if (!user_cert_combobox_ || !enable_user_cert_) |
| 1028 return false; | 1028 return false; |
| 1029 int index = user_cert_combobox_->selected_index(); | 1029 int index = user_cert_combobox_->selected_index(); |
| 1030 if (index < 0) | 1030 if (index < 0) |
| 1031 return false; | 1031 return false; |
| 1032 // Currently only hardware-backed user certificates are valid. | 1032 // Currently only hardware-backed user certificates are valid. |
|
stevenjb
2016/11/08 20:09:37
Update comment.
Kevin Cernekee
2016/11/08 21:00:41
Done.
| |
| 1033 if (!CertLibrary::Get()->IsCertHardwareBackedAt(CertLibrary::CERT_TYPE_USER, | 1033 if (!CertLibrary::Get()->IsCertSecureAt(CertLibrary::CERT_TYPE_USER, index)) { |
| 1034 index)) { | |
| 1035 return false; | 1034 return false; |
| 1036 } | 1035 } |
| 1037 return true; | 1036 return true; |
| 1038 } | 1037 } |
| 1039 | 1038 |
| 1040 const std::string VPNConfigView::GetTextFromField(views::Textfield* textfield, | 1039 const std::string VPNConfigView::GetTextFromField(views::Textfield* textfield, |
| 1041 bool trim_whitespace) const { | 1040 bool trim_whitespace) const { |
| 1042 if (!textfield) | 1041 if (!textfield) |
| 1043 return std::string(); | 1042 return std::string(); |
| 1044 std::string untrimmed = base::UTF16ToUTF8(textfield->text()); | 1043 std::string untrimmed = base::UTF16ToUTF8(textfield->text()); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 1069 property_ui_data->ParseOncProperty( | 1068 property_ui_data->ParseOncProperty( |
| 1070 onc_source, | 1069 onc_source, |
| 1071 onc, | 1070 onc, |
| 1072 base::StringPrintf("%s.%s.%s", | 1071 base::StringPrintf("%s.%s.%s", |
| 1073 ::onc::network_config::kVPN, | 1072 ::onc::network_config::kVPN, |
| 1074 dict_key.c_str(), | 1073 dict_key.c_str(), |
| 1075 key.c_str())); | 1074 key.c_str())); |
| 1076 } | 1075 } |
| 1077 | 1076 |
| 1078 } // namespace chromeos | 1077 } // namespace chromeos |
| OLD | NEW |