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

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

Issue 2806283002: Revert of Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Created 3 years, 8 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility>
10
11 #include "base/bind.h" 9 #include "base/bind.h"
12 #include "base/macros.h" 10 #include "base/macros.h"
13 #include "base/memory/ptr_util.h"
14 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
15 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
16 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
17 #include "chrome/browser/chromeos/enrollment_dialog_view.h" 14 #include "chrome/browser/chromeos/enrollment_dialog_view.h"
18 #include "chrome/browser/chromeos/net/shill_error.h" 15 #include "chrome/browser/chromeos/net/shill_error.h"
19 #include "chrome/browser/profiles/profile_manager.h" 16 #include "chrome/browser/profiles/profile_manager.h"
20 #include "chrome/browser/ui/views/harmony/layout_delegate.h" 17 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
21 #include "chrome/common/net/x509_certificate_model.h" 18 #include "chrome/common/net/x509_certificate_model.h"
22 #include "chrome/grit/generated_resources.h" 19 #include "chrome/grit/generated_resources.h"
23 #include "chromeos/login/login_state.h" 20 #include "chromeos/login/login_state.h"
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 } 858 }
862 if (!user_passphrase.empty()) { 859 if (!user_passphrase.empty()) {
863 properties->SetStringWithoutPathExpansion( 860 properties->SetStringWithoutPathExpansion(
864 shill::kL2tpIpsecPasswordProperty, user_passphrase); 861 shill::kL2tpIpsecPasswordProperty, user_passphrase);
865 } 862 }
866 break; 863 break;
867 } 864 }
868 case PROVIDER_TYPE_INDEX_L2TP_IPSEC_USER_CERT: { 865 case PROVIDER_TYPE_INDEX_L2TP_IPSEC_USER_CERT: {
869 if (server_ca_cert_combobox_) { 866 if (server_ca_cert_combobox_) {
870 std::string ca_cert_pem = GetServerCACertPEM(); 867 std::string ca_cert_pem = GetServerCACertPEM();
871 auto pem_list = base::MakeUnique<base::ListValue>(); 868 base::ListValue* pem_list = new base::ListValue;
872 if (!ca_cert_pem.empty()) 869 if (!ca_cert_pem.empty())
873 pem_list->AppendString(ca_cert_pem); 870 pem_list->AppendString(ca_cert_pem);
874 properties->SetWithoutPathExpansion(shill::kL2tpIpsecCaCertPemProperty, 871 properties->SetWithoutPathExpansion(shill::kL2tpIpsecCaCertPemProperty,
875 std::move(pem_list)); 872 pem_list);
876 } 873 }
877 SetUserCertProperties(client_cert::CONFIG_TYPE_IPSEC, properties); 874 SetUserCertProperties(client_cert::CONFIG_TYPE_IPSEC, properties);
878 if (!group_name.empty()) { 875 if (!group_name.empty()) {
879 properties->SetStringWithoutPathExpansion( 876 properties->SetStringWithoutPathExpansion(
880 shill::kL2tpIpsecTunnelGroupProperty, GetGroupName()); 877 shill::kL2tpIpsecTunnelGroupProperty, GetGroupName());
881 } 878 }
882 if (!user_name.empty()) { 879 if (!user_name.empty()) {
883 properties->SetStringWithoutPathExpansion( 880 properties->SetStringWithoutPathExpansion(
884 shill::kL2tpIpsecUserProperty, user_name); 881 shill::kL2tpIpsecUserProperty, user_name);
885 } 882 }
886 if (!user_passphrase.empty()) { 883 if (!user_passphrase.empty()) {
887 properties->SetStringWithoutPathExpansion( 884 properties->SetStringWithoutPathExpansion(
888 shill::kL2tpIpsecPasswordProperty, user_passphrase); 885 shill::kL2tpIpsecPasswordProperty, user_passphrase);
889 } 886 }
890 break; 887 break;
891 } 888 }
892 case PROVIDER_TYPE_INDEX_OPEN_VPN: { 889 case PROVIDER_TYPE_INDEX_OPEN_VPN: {
893 if (server_ca_cert_combobox_) { 890 if (server_ca_cert_combobox_) {
894 std::string ca_cert_pem = GetServerCACertPEM(); 891 std::string ca_cert_pem = GetServerCACertPEM();
895 auto pem_list = base::MakeUnique<base::ListValue>(); 892 base::ListValue* pem_list = new base::ListValue;
896 if (!ca_cert_pem.empty()) 893 if (!ca_cert_pem.empty())
897 pem_list->AppendString(ca_cert_pem); 894 pem_list->AppendString(ca_cert_pem);
898 properties->SetWithoutPathExpansion(shill::kOpenVPNCaCertPemProperty, 895 properties->SetWithoutPathExpansion(shill::kOpenVPNCaCertPemProperty,
899 std::move(pem_list)); 896 pem_list);
900 } 897 }
901 SetUserCertProperties(client_cert::CONFIG_TYPE_OPENVPN, properties); 898 SetUserCertProperties(client_cert::CONFIG_TYPE_OPENVPN, properties);
902 properties->SetStringWithoutPathExpansion( 899 properties->SetStringWithoutPathExpansion(
903 shill::kOpenVPNUserProperty, GetUsername()); 900 shill::kOpenVPNUserProperty, GetUsername());
904 if (!user_passphrase.empty()) { 901 if (!user_passphrase.empty()) {
905 properties->SetStringWithoutPathExpansion( 902 properties->SetStringWithoutPathExpansion(
906 shill::kOpenVPNPasswordProperty, user_passphrase); 903 shill::kOpenVPNPasswordProperty, user_passphrase);
907 } 904 }
908 std::string otp = GetOTP(); 905 std::string otp = GetOTP();
909 if (!otp.empty()) { 906 if (!otp.empty()) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 property_ui_data->ParseOncProperty( 1093 property_ui_data->ParseOncProperty(
1097 onc_source, 1094 onc_source,
1098 onc, 1095 onc,
1099 base::StringPrintf("%s.%s.%s", 1096 base::StringPrintf("%s.%s.%s",
1100 ::onc::network_config::kVPN, 1097 ::onc::network_config::kVPN,
1101 dict_key.c_str(), 1098 dict_key.c_str(),
1102 key.c_str())); 1099 key.c_str()));
1103 } 1100 }
1104 1101
1105 } // namespace chromeos 1102 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698