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

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

Issue 11414101: This adds ManagedNetworkConfigurationHandler first pass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upload after merge Created 7 years, 10 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
« no previous file with comments | « chromeos/network/onc/onc_signature.h ('k') | chromeos/network/onc/onc_translator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_signature.h" 5 #include "chromeos/network/onc/onc_signature.h"
6 6
7 #include "chromeos/network/onc/onc_constants.h" 7 #include "chromeos/network/onc/onc_constants.h"
8 #include "third_party/cros_system_api/dbus/service_constants.h" 8 #include "third_party/cros_system_api/dbus/service_constants.h"
9 9
10 using base::Value; 10 using base::Value;
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 const OncValueSignature kCertificateListSignature = { 379 const OncValueSignature kCertificateListSignature = {
380 Value::TYPE_LIST, NULL, &kCertificateSignature 380 Value::TYPE_LIST, NULL, &kCertificateSignature
381 }; 381 };
382 const OncValueSignature kNetworkConfigurationListSignature = { 382 const OncValueSignature kNetworkConfigurationListSignature = {
383 Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature 383 Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature
384 }; 384 };
385 const OncValueSignature kToplevelConfigurationSignature = { 385 const OncValueSignature kToplevelConfigurationSignature = {
386 Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL 386 Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL
387 }; 387 };
388 388
389 const OncFieldSignature* GetFieldSignature(const OncValueSignature& signature, 389 const OncFieldSignature* GetOncFieldSignature(
390 const std::string& onc_field_name) { 390 const OncValueSignature& signature,
391 const std::string& onc_field_name) {
391 if (!signature.fields) 392 if (!signature.fields)
392 return NULL; 393 return NULL;
393 for (const OncFieldSignature* field_signature = signature.fields; 394 for (const OncFieldSignature* field_signature = signature.fields;
394 field_signature->onc_field_name != NULL; ++field_signature) { 395 field_signature->onc_field_name != NULL; ++field_signature) {
395 if (onc_field_name == field_signature->onc_field_name) 396 if (onc_field_name == field_signature->onc_field_name)
396 return field_signature; 397 return field_signature;
397 } 398 }
398 return NULL; 399 return NULL;
399 } 400 }
400 401
402 const OncFieldSignature* GetShillFieldSignature(
403 const OncValueSignature& signature,
404 const std::string& shill_property_name) {
405 if (!signature.fields)
406 return NULL;
407 for (const OncFieldSignature* field_signature = signature.fields;
408 field_signature->onc_field_name != NULL; ++field_signature) {
409 if (shill_property_name == field_signature->shill_property_name)
410 return field_signature;
411 }
412 return NULL;
413 }
414
415
401 } // namespace onc 416 } // namespace onc
402 } // namespace chromeos 417 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_signature.h ('k') | chromeos/network/onc/onc_translator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698