const ui::Event& event) {
}
-void VPNConfigView::OnSelectedIndexChanged(views::Combobox* combobox) {
+void VPNConfigView::OnPerformAction(views::Combobox* combobox) {
UpdateControls();
UpdateErrorLabel();
UpdateCanLogin();
shill::kProviderTypeProperty, GetProviderTypeString());
SetConfigProperties(&properties);
- bool shared = !LoginState::Get()->IsUserAuthenticated();
+ bool shared = false;
+ bool modifiable = false;
+ ChildNetworkConfigView::GetShareStateForLoginState(&shared, &modifiable);
bool only_policy_autoconnect =
onc::PolicyAllowsOnlyPolicyNetworksToAutoconnect(!shared);
return std::string();
} else {
int cert_index = index - 1;
- return CertLibrary::Get()->GetCertPEMAt(
- CertLibrary::CERT_TYPE_SERVER_CA, cert_index);
+ return CertLibrary::Get()->GetServerCACertPEMAt(cert_index);
}
}
} else {
// Certificates are listed in the order they appear in the model.
int index = user_cert_combobox_ ? user_cert_combobox_->selected_index() : 0;
- return CertLibrary::Get()->GetCertPkcs11IdAt(
- CertLibrary::CERT_TYPE_USER, index);
+ return CertLibrary::Get()->GetUserCertPkcs11IdAt(index);
}
}
server_ca_cert_combobox_->ModelChanged();
if (enable_server_ca_cert_ && !ca_cert_pem_.empty()) {
// Select the current server CA certificate in the combobox.
- int cert_index = CertLibrary::Get()->GetCertIndexByPEM(
- CertLibrary::CERT_TYPE_SERVER_CA, ca_cert_pem_);
+ int cert_index =
+ CertLibrary::Get()->GetServerCACertIndexByPEM(ca_cert_pem_);
if (cert_index >= 0) {
// Skip item for "Default"
server_ca_cert_combobox_->SetSelectedIndex(1 + cert_index);
if (user_cert_combobox_) {
user_cert_combobox_->ModelChanged();
if (enable_user_cert_ && !client_cert_id_.empty()) {
- int cert_index = CertLibrary::Get()->GetCertIndexByPkcs11Id(
- CertLibrary::CERT_TYPE_USER, client_cert_id_);
+ int cert_index =
+ CertLibrary::Get()->GetUserCertIndexByPkcs11Id(client_cert_id_);
if (cert_index >= 0)
user_cert_combobox_->SetSelectedIndex(cert_index);
else
const NetworkState* vpn = NetworkHandler::Get()->network_state_handler()->
GetNetworkState(service_path_);
if (vpn && vpn->connection_state() == shill::kStateFailure)
- error_msg = ash::network_connect::ErrorString(vpn->error(), vpn->path());
+ error_msg = ash::network_connect::ErrorString(
+ vpn->last_error(), vpn->path());
}
if (!error_msg.empty()) {
error_label_->SetText(error_msg);
if (!trim_whitespace)
return untrimmed;
std::string result;
- TrimWhitespaceASCII(untrimmed, TRIM_ALL, &result);
+ base::TrimWhitespaceASCII(untrimmed, base::TRIM_ALL, &result);
return result;
}