| Index: chrome/browser/chromeos/options/vpn_config_view.cc
|
| diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc
|
| index bf8f30f7b0502d4acdd26f8335622cac4b45aab5..e8fe484aafa6ee14336c3543a7b91948abffb8d2 100644
|
| --- a/chrome/browser/chromeos/options/vpn_config_view.cc
|
| +++ b/chrome/browser/chromeos/options/vpn_config_view.cc
|
| @@ -363,15 +363,15 @@ const std::string VPNConfigView::GetOTP() const {
|
|
|
| const std::string VPNConfigView::GetServerCACertNssNickname() const {
|
| DCHECK(cert_library_);
|
| - int selected =
|
| - server_ca_cert_combobox_ ? server_ca_cert_combobox_->selected_item() : 0;
|
| - if (selected == 0) {
|
| + int index = server_ca_cert_combobox_ ?
|
| + server_ca_cert_combobox_->selected_index() : 0;
|
| + if (index == 0) {
|
| // First item is "Default".
|
| return std::string();
|
| } else {
|
| DCHECK(cert_library_);
|
| DCHECK_GT(cert_library_->GetCACertificates().Size(), 0);
|
| - int cert_index = selected - 1;
|
| + int cert_index = index - 1;
|
| return cert_library_->GetCACertificates().GetNicknameAt(cert_index);
|
| }
|
| }
|
| @@ -382,9 +382,8 @@ const std::string VPNConfigView::GetUserCertID() const {
|
| return std::string(); // "None installed"
|
| } else {
|
| // Certificates are listed in the order they appear in the model.
|
| - int selected =
|
| - user_cert_combobox_ ? user_cert_combobox_->selected_item() : 0;
|
| - return cert_library_->GetUserCertificates().GetPkcs11IdAt(selected);
|
| + int index = user_cert_combobox_ ? user_cert_combobox_->selected_index() : 0;
|
| + return cert_library_->GetUserCertificates().GetPkcs11IdAt(index);
|
| }
|
| }
|
|
|
| @@ -638,12 +637,12 @@ void VPNConfigView::Refresh() {
|
| vpn->ca_cert_nss());
|
| if (cert_index >= 0) {
|
| // Skip item for "Default"
|
| - server_ca_cert_combobox_->SetSelectedItem(1 + cert_index);
|
| + server_ca_cert_combobox_->SetSelectedIndex(1 + cert_index);
|
| } else {
|
| - server_ca_cert_combobox_->SetSelectedItem(0);
|
| + server_ca_cert_combobox_->SetSelectedIndex(0);
|
| }
|
| } else {
|
| - server_ca_cert_combobox_->SetSelectedItem(0);
|
| + server_ca_cert_combobox_->SetSelectedIndex(0);
|
| }
|
| }
|
|
|
| @@ -654,11 +653,11 @@ void VPNConfigView::Refresh() {
|
| int cert_index = cert_library_->GetUserCertificates().FindCertByPkcs11Id(
|
| vpn->client_cert_id());
|
| if (cert_index >= 0)
|
| - user_cert_combobox_->SetSelectedItem(cert_index);
|
| + user_cert_combobox_->SetSelectedIndex(cert_index);
|
| else
|
| - user_cert_combobox_->SetSelectedItem(0);
|
| + user_cert_combobox_->SetSelectedIndex(0);
|
| } else {
|
| - user_cert_combobox_->SetSelectedItem(0);
|
| + user_cert_combobox_->SetSelectedIndex(0);
|
| }
|
| }
|
|
|
| @@ -775,18 +774,18 @@ bool VPNConfigView::HaveUserCerts() const {
|
| bool VPNConfigView::IsUserCertValid() const {
|
| if (!user_cert_combobox_ || !enable_user_cert_)
|
| return false;
|
| - int selected = user_cert_combobox_->selected_item();
|
| - if (selected < 0)
|
| + int index = user_cert_combobox_->selected_index();
|
| + if (index < 0)
|
| return false;
|
| // Currently only hardware-backed user certificates are valid.
|
| if (cert_library_->IsHardwareBacked() &&
|
| - !cert_library_->GetUserCertificates().IsHardwareBackedAt(selected))
|
| + !cert_library_->GetUserCertificates().IsHardwareBackedAt(index))
|
| return false;
|
| return true;
|
| }
|
|
|
| -const std::string VPNConfigView::GetTextFromField(
|
| - views::Textfield* textfield, bool trim_whitespace) const {
|
| +const std::string VPNConfigView::GetTextFromField(views::Textfield* textfield,
|
| + bool trim_whitespace) const {
|
| if (!textfield)
|
| return std::string();
|
| std::string untrimmed = UTF16ToUTF8(textfield->text());
|
|
|