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

Side by Side Diff: chromeos/network/onc/onc_translator_shill_to_onc.cc

Issue 571123002: Fix some properties on the settings page read from ONC. (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
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 "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
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 TranslateAndAddNestedObject(onc_network_type); 396 // Wimax is not supported by ONC, yet.
stevenjb 2014/09/15 16:38:41 Let's make sure there is a big TODO here, even if
pneubeck (no reviews) 2014/09/15 20:27:13 Done.
397 if (onc_network_type != ::onc::network_type::kWimax)
398 TranslateAndAddNestedObject(onc_network_type);
397 } 399 }
398 400
399 // Since Name is a read only field in Shill unless it's a VPN, it is copied 401 // Since Name is a read only field in Shill unless it's a VPN, it is copied
400 // here, but not when going the other direction (if it's not a VPN). 402 // here, but not when going the other direction (if it's not a VPN).
401 std::string name; 403 std::string name;
402 shill_dictionary_->GetStringWithoutPathExpansion(shill::kNameProperty, &name); 404 shill_dictionary_->GetStringWithoutPathExpansion(shill::kNameProperty, &name);
403 onc_object_->SetStringWithoutPathExpansion(::onc::network_config::kName, 405 onc_object_->SetStringWithoutPathExpansion(::onc::network_config::kName,
404 name); 406 name);
405 407
406 // Limit ONC state to "NotConnected", "Connected", or "Connecting". 408 // Limit ONC state to "NotConnected", "Connected", or "Connecting".
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 ::onc::ONCSource onc_source, 668 ::onc::ONCSource onc_source,
667 const OncValueSignature* onc_signature) { 669 const OncValueSignature* onc_signature) {
668 CHECK(onc_signature != NULL); 670 CHECK(onc_signature != NULL);
669 671
670 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature); 672 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature);
671 return translator.CreateTranslatedONCObject(); 673 return translator.CreateTranslatedONCObject();
672 } 674 }
673 675
674 } // namespace onc 676 } // namespace onc
675 } // namespace chromeos 677 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698