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/onc/onc_translator.h" | 5 #include "chromeos/network/onc/onc_translator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 std::string onc_network_type = ::onc::network_type::kEthernet; | 386 std::string onc_network_type = ::onc::network_type::kEthernet; |
387 if (shill_network_type != shill::kTypeEthernet && | 387 if (shill_network_type != shill::kTypeEthernet && |
388 shill_network_type != shill::kTypeEthernetEap) { | 388 shill_network_type != shill::kTypeEthernetEap) { |
389 TranslateStringToONC( | 389 TranslateStringToONC( |
390 kNetworkTypeTable, shill_network_type, &onc_network_type); | 390 kNetworkTypeTable, shill_network_type, &onc_network_type); |
391 } | 391 } |
392 // Translate nested Cellular, WiFi, etc. properties. | 392 // Translate nested Cellular, WiFi, etc. properties. |
393 if (!onc_network_type.empty()) { | 393 if (!onc_network_type.empty()) { |
394 onc_object_->SetStringWithoutPathExpansion(::onc::network_config::kType, | 394 onc_object_->SetStringWithoutPathExpansion(::onc::network_config::kType, |
395 onc_network_type); | 395 onc_network_type); |
396 // Wimax is not supported by ONC, yet. | 396 TranslateAndAddNestedObject(onc_network_type); |
397 // TOOD(pneubeck): Wimax support is required, see https://crbug.com/414417 . | |
398 if (onc_network_type != ::onc::network_type::kWimax) | |
399 TranslateAndAddNestedObject(onc_network_type); | |
400 } | 397 } |
401 | 398 |
402 // Since Name is a read only field in Shill unless it's a VPN, it is copied | 399 // Since Name is a read only field in Shill unless it's a VPN, it is copied |
403 // here, but not when going the other direction (if it's not a VPN). | 400 // here, but not when going the other direction (if it's not a VPN). |
404 std::string name; | 401 std::string name; |
405 shill_dictionary_->GetStringWithoutPathExpansion(shill::kNameProperty, &name); | 402 shill_dictionary_->GetStringWithoutPathExpansion(shill::kNameProperty, &name); |
406 onc_object_->SetStringWithoutPathExpansion(::onc::network_config::kName, | 403 onc_object_->SetStringWithoutPathExpansion(::onc::network_config::kName, |
407 name); | 404 name); |
408 | 405 |
409 // Limit ONC state to "NotConnected", "Connected", or "Connecting". | 406 // Limit ONC state to "NotConnected", "Connected", or "Connecting". |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 ::onc::ONCSource onc_source, | 666 ::onc::ONCSource onc_source, |
670 const OncValueSignature* onc_signature) { | 667 const OncValueSignature* onc_signature) { |
671 CHECK(onc_signature != NULL); | 668 CHECK(onc_signature != NULL); |
672 | 669 |
673 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature); | 670 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature); |
674 return translator.CreateTranslatedONCObject(); | 671 return translator.CreateTranslatedONCObject(); |
675 } | 672 } |
676 | 673 |
677 } // namespace onc | 674 } // namespace onc |
678 } // namespace chromeos | 675 } // namespace chromeos |
OLD | NEW |