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

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

Issue 492383002: Use ONC for Cellular APN and SimLock in Settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests 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 | Annotate | Revision Log
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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 CopyPropertiesAccordingToSignature(); 302 CopyPropertiesAccordingToSignature();
303 const base::DictionaryValue* dictionary = NULL; 303 const base::DictionaryValue* dictionary = NULL;
304 if (shill_dictionary_->GetDictionaryWithoutPathExpansion( 304 if (shill_dictionary_->GetDictionaryWithoutPathExpansion(
305 shill::kServingOperatorProperty, &dictionary)) { 305 shill::kServingOperatorProperty, &dictionary)) {
306 TranslateAndAddNestedObject(::onc::cellular::kServingOperator, *dictionary); 306 TranslateAndAddNestedObject(::onc::cellular::kServingOperator, *dictionary);
307 } 307 }
308 if (shill_dictionary_->GetDictionaryWithoutPathExpansion( 308 if (shill_dictionary_->GetDictionaryWithoutPathExpansion(
309 shill::kCellularApnProperty, &dictionary)) { 309 shill::kCellularApnProperty, &dictionary)) {
310 TranslateAndAddNestedObject(::onc::cellular::kAPN, *dictionary); 310 TranslateAndAddNestedObject(::onc::cellular::kAPN, *dictionary);
311 } 311 }
312 if (shill_dictionary_->GetDictionaryWithoutPathExpansion(
313 shill::kCellularLastGoodApnProperty, &dictionary)) {
314 TranslateAndAddNestedObject(::onc::cellular::kLastGoodAPN, *dictionary);
315 }
312 // Merge the Device dictionary with this one (Cellular) using the 316 // Merge the Device dictionary with this one (Cellular) using the
313 // CellularDevice signature. 317 // CellularDevice signature.
314 const base::DictionaryValue* device_dictionary = NULL; 318 const base::DictionaryValue* device_dictionary = NULL;
315 if (!shill_dictionary_->GetDictionaryWithoutPathExpansion( 319 if (!shill_dictionary_->GetDictionaryWithoutPathExpansion(
316 shill::kDeviceProperty, &device_dictionary)) { 320 shill::kDeviceProperty, &device_dictionary)) {
317 return; 321 return;
318 } 322 }
319 ShillToONCTranslator nested_translator(*device_dictionary, 323 ShillToONCTranslator nested_translator(*device_dictionary,
320 kCellularWithStateSignature, 324 kCellularWithStateSignature,
321 kCellularDeviceTable); 325 kCellularDeviceTable);
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 const base::DictionaryValue& shill_dictionary, 574 const base::DictionaryValue& shill_dictionary,
571 const OncValueSignature* onc_signature) { 575 const OncValueSignature* onc_signature) {
572 CHECK(onc_signature != NULL); 576 CHECK(onc_signature != NULL);
573 577
574 ShillToONCTranslator translator(shill_dictionary, *onc_signature); 578 ShillToONCTranslator translator(shill_dictionary, *onc_signature);
575 return translator.CreateTranslatedONCObject(); 579 return translator.CreateTranslatedONCObject();
576 } 580 }
577 581
578 } // namespace onc 582 } // namespace onc
579 } // namespace chromeos 583 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698