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 "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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 } | 1022 } |
1023 | 1023 |
1024 const std::string VPNConfigView::GetTextFromField(views::Textfield* textfield, | 1024 const std::string VPNConfigView::GetTextFromField(views::Textfield* textfield, |
1025 bool trim_whitespace) const { | 1025 bool trim_whitespace) const { |
1026 if (!textfield) | 1026 if (!textfield) |
1027 return std::string(); | 1027 return std::string(); |
1028 std::string untrimmed = base::UTF16ToUTF8(textfield->text()); | 1028 std::string untrimmed = base::UTF16ToUTF8(textfield->text()); |
1029 if (!trim_whitespace) | 1029 if (!trim_whitespace) |
1030 return untrimmed; | 1030 return untrimmed; |
1031 std::string result; | 1031 std::string result; |
1032 TrimWhitespaceASCII(untrimmed, TRIM_ALL, &result); | 1032 base::TrimWhitespaceASCII(untrimmed, base::TRIM_ALL, &result); |
1033 return result; | 1033 return result; |
1034 } | 1034 } |
1035 | 1035 |
1036 const std::string VPNConfigView::GetPassphraseFromField( | 1036 const std::string VPNConfigView::GetPassphraseFromField( |
1037 PassphraseTextfield* textfield) const { | 1037 PassphraseTextfield* textfield) const { |
1038 if (!textfield) | 1038 if (!textfield) |
1039 return std::string(); | 1039 return std::string(); |
1040 return textfield->GetPassphrase(); | 1040 return textfield->GetPassphrase(); |
1041 } | 1041 } |
1042 | 1042 |
(...skipping 10 matching lines...) Expand all Loading... |
1053 property_ui_data->ParseOncProperty( | 1053 property_ui_data->ParseOncProperty( |
1054 onc_source, | 1054 onc_source, |
1055 onc, | 1055 onc, |
1056 base::StringPrintf("%s.%s.%s", | 1056 base::StringPrintf("%s.%s.%s", |
1057 ::onc::network_config::kVPN, | 1057 ::onc::network_config::kVPN, |
1058 dict_key.c_str(), | 1058 dict_key.c_str(), |
1059 key.c_str())); | 1059 key.c_str())); |
1060 } | 1060 } |
1061 | 1061 |
1062 } // namespace chromeos | 1062 } // namespace chromeos |
OLD | NEW |