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 "chromeos/network/network_util.h" | 5 #include "chromeos/network/network_util.h" |
6 | 6 |
7 #include "base/strings/string_tokenizer.h" | 7 #include "base/strings/string_tokenizer.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chromeos/network/network_state.h" | 10 #include "chromeos/network/network_state.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 | 185 |
186 std::string TranslateONCTypeToShill(const std::string& onc_type) { | 186 std::string TranslateONCTypeToShill(const std::string& onc_type) { |
187 if (onc_type == ::onc::network_type::kEthernet) | 187 if (onc_type == ::onc::network_type::kEthernet) |
188 return shill::kTypeEthernet; | 188 return shill::kTypeEthernet; |
189 std::string shill_type; | 189 std::string shill_type; |
190 onc::TranslateStringToShill(onc::kNetworkTypeTable, onc_type, &shill_type); | 190 onc::TranslateStringToShill(onc::kNetworkTypeTable, onc_type, &shill_type); |
191 return shill_type; | 191 return shill_type; |
192 } | 192 } |
193 | 193 |
| 194 std::string TranslateShillTypeToONC(const std::string& shill_type) { |
| 195 if (shill_type == shill::kTypeEthernet) |
| 196 return ::onc::network_type::kEthernet; |
| 197 std::string onc_type; |
| 198 onc::TranslateStringToONC(onc::kNetworkTypeTable, shill_type, &onc_type); |
| 199 return onc_type; |
| 200 } |
| 201 |
194 } // namespace network_util | 202 } // namespace network_util |
195 } // namespace chromeos | 203 } // namespace chromeos |
OLD | NEW |