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

Side by Side Diff: chrome/browser/chromeos/options/vpn_config_view.cc

Issue 552353002: Fix un-selecting user cert for VPN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/system/chromeos/network/network_connect.h" 7 #include "ash/system/chromeos/network/network_connect.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 int cert_index = index - 1; 447 int cert_index = index - 1;
448 return CertLibrary::Get()->GetServerCACertPEMAt(cert_index); 448 return CertLibrary::Get()->GetServerCACertPEMAt(cert_index);
449 } 449 }
450 } 450 }
451 451
452 void VPNConfigView::SetUserCertProperties( 452 void VPNConfigView::SetUserCertProperties(
453 chromeos::client_cert::ConfigType client_cert_type, 453 chromeos::client_cert::ConfigType client_cert_type,
454 base::DictionaryValue* properties) const { 454 base::DictionaryValue* properties) const {
455 if (!HaveUserCerts()) { 455 if (!HaveUserCerts()) {
456 // No certificate selected or not required. 456 // No certificate selected or not required.
457 chromeos::client_cert::SetEmptyShillProperties( 457 chromeos::client_cert::SetEmptyShillProperties(client_cert_type,
458 chromeos::client_cert::CONFIG_TYPE_EAP, properties); 458 properties);
459 } else { 459 } else {
460 // Certificates are listed in the order they appear in the model. 460 // Certificates are listed in the order they appear in the model.
461 int index = user_cert_combobox_ ? user_cert_combobox_->selected_index() : 0; 461 int index = user_cert_combobox_ ? user_cert_combobox_->selected_index() : 0;
462 int slot_id = -1; 462 int slot_id = -1;
463 const std::string pkcs11_id = 463 const std::string pkcs11_id =
464 CertLibrary::Get()->GetUserCertPkcs11IdAt(index, &slot_id); 464 CertLibrary::Get()->GetUserCertPkcs11IdAt(index, &slot_id);
465 chromeos::client_cert::SetShillProperties( 465 chromeos::client_cert::SetShillProperties(
466 client_cert_type, slot_id, pkcs11_id, properties); 466 client_cert_type, slot_id, pkcs11_id, properties);
467 } 467 }
468 } 468 }
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 property_ui_data->ParseOncProperty( 1060 property_ui_data->ParseOncProperty(
1061 onc_source, 1061 onc_source,
1062 onc, 1062 onc,
1063 base::StringPrintf("%s.%s.%s", 1063 base::StringPrintf("%s.%s.%s",
1064 ::onc::network_config::kVPN, 1064 ::onc::network_config::kVPN,
1065 dict_key.c_str(), 1065 dict_key.c_str(),
1066 key.c_str())); 1066 key.c_str()));
1067 } 1067 }
1068 1068
1069 } // namespace chromeos 1069 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698