Index: chromeos/network/onc/onc_translator_shill_to_onc.cc |
diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc |
index aca9133531a30036716f94a569eba3aff3c4d008..d918156dfffa41db1d929970196669690b4d00fa 100644 |
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc |
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc |
@@ -52,25 +52,21 @@ |
public: |
ShillToONCTranslator(const base::DictionaryValue& shill_dictionary, |
::onc::ONCSource onc_source, |
+ const OncValueSignature& onc_signature) |
+ : shill_dictionary_(&shill_dictionary), |
+ onc_source_(onc_source), |
+ onc_signature_(&onc_signature) { |
+ field_translation_table_ = GetFieldTranslationTable(onc_signature); |
+ } |
+ |
+ ShillToONCTranslator(const base::DictionaryValue& shill_dictionary, |
+ ::onc::ONCSource onc_source, |
const OncValueSignature& onc_signature, |
- const NetworkState* network_state) |
+ const FieldTranslationEntry* field_translation_table) |
: shill_dictionary_(&shill_dictionary), |
onc_source_(onc_source), |
onc_signature_(&onc_signature), |
- network_state_(network_state) { |
- field_translation_table_ = GetFieldTranslationTable(onc_signature); |
- } |
- |
- ShillToONCTranslator(const base::DictionaryValue& shill_dictionary, |
- ::onc::ONCSource onc_source, |
- const OncValueSignature& onc_signature, |
- const FieldTranslationEntry* field_translation_table, |
- const NetworkState* network_state) |
- : shill_dictionary_(&shill_dictionary), |
- onc_source_(onc_source), |
- onc_signature_(&onc_signature), |
- field_translation_table_(field_translation_table), |
- network_state_(network_state) {} |
+ field_translation_table_(field_translation_table) {} |
// Translates the associated Shill dictionary and creates an ONC object of the |
// given signature. |
@@ -146,7 +142,6 @@ |
const OncValueSignature* onc_signature_; |
const FieldTranslationEntry* field_translation_table_; |
scoped_ptr<base::DictionaryValue> onc_object_; |
- const NetworkState* network_state_; |
DISALLOW_COPY_AND_ASSIGN(ShillToONCTranslator); |
}; |
@@ -387,9 +382,9 @@ |
if (device_dictionary) { |
// Merge the Device dictionary with this one (Cellular) using the |
// CellularDevice signature. |
- ShillToONCTranslator nested_translator( |
- *device_dictionary, onc_source_, kCellularWithStateSignature, |
- kCellularDeviceTable, network_state_); |
+ ShillToONCTranslator nested_translator(*device_dictionary, onc_source_, |
+ kCellularWithStateSignature, |
+ kCellularDeviceTable); |
scoped_ptr<base::DictionaryValue> nested_object = |
nested_translator.CreateTranslatedONCObject(); |
onc_object_->MergeDictionary(nested_object.get()); |
@@ -476,17 +471,6 @@ |
if (NetworkState::NetworkStateIsCaptivePortal(*shill_dictionary_)) { |
onc_object_->SetBooleanWithoutPathExpansion( |
::onc::network_config::kRestrictedConnectivity, true); |
- } |
- } |
- |
- // 'ErrorState' reflects the most recent error maintained in NetworkState |
- // (which may not match Shill's Error or PreviousError properties). Non |
- // visible networks (with null network_state_) do not set ErrorState. |
- if (network_state_) { |
- std::string error_state = network_state_->GetErrorState(); |
- if (!error_state.empty()) { |
- onc_object_->SetStringWithoutPathExpansion( |
- ::onc::network_config::kErrorState, error_state); |
} |
} |
@@ -617,8 +601,7 @@ |
return; |
} |
ShillToONCTranslator nested_translator(dictionary, onc_source_, |
- *field_signature->value_signature, |
- network_state_); |
+ *field_signature->value_signature); |
scoped_ptr<base::DictionaryValue> nested_object = |
nested_translator.CreateTranslatedONCObject(); |
if (nested_object->empty()) |
@@ -659,8 +642,7 @@ |
continue; |
ShillToONCTranslator nested_translator( |
*shill_value, onc_source_, |
- *field_signature->value_signature->onc_array_entry_signature, |
- network_state_); |
+ *field_signature->value_signature->onc_array_entry_signature); |
scoped_ptr<base::DictionaryValue> nested_object = |
nested_translator.CreateTranslatedONCObject(); |
// If the nested object couldn't be parsed, simply omit it. |
@@ -746,12 +728,10 @@ |
scoped_ptr<base::DictionaryValue> TranslateShillServiceToONCPart( |
const base::DictionaryValue& shill_dictionary, |
::onc::ONCSource onc_source, |
- const OncValueSignature* onc_signature, |
- const NetworkState* network_state) { |
+ const OncValueSignature* onc_signature) { |
CHECK(onc_signature != NULL); |
- ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, |
- network_state); |
+ ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature); |
return translator.CreateTranslatedONCObject(); |
} |