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

Side by Side Diff: chrome/browser/chromeos/network_settings/onc_translator.h

Issue 11299236: This moves the ONC parsing code into chromeos/network/onc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit tests Created 8 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_TRANSLATOR_H_
6 #define CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_TRANSLATOR_H_
7
8 #include "base/memory/scoped_ptr.h"
9
10 namespace base {
11 class DictionaryValue;
12 }
13
14 namespace chromeos {
15 namespace onc {
16
17 struct OncValueSignature;
18
19 // Translates a hierarchical ONC dictionary |onc_object| to a flat Shill
20 // dictionary. The |signature| declares the type of |onc_object| and must point
21 // to one of the signature objects in "onc_signature.h". The resulting Shill
22 // dictionary is returned.
23 //
24 // This function is used to translate network settings from ONC to Shill's
25 // format before sending them to Shill.
26 scoped_ptr<base::DictionaryValue> TranslateONCObjectToShill(
27 const OncValueSignature* signature,
28 const base::DictionaryValue& onc_object);
29
30 // Translates a |shill_dictionary| to an ONC object according to the given
31 // |onc_signature|. |onc_signature| must point to a signature object in
32 // "onc_signature.h". The resulting ONC object is returned.
33 //
34 // This function is used to translate network settings coming from Shill to ONC
35 // before sending them to the UI. The result doesn't have to be valid ONC, but
36 // only a subset of it and includes only the values that are actually required
37 // by the UI.
38 scoped_ptr<base::DictionaryValue> TranslateShillServiceToONCPart(
39 const base::DictionaryValue& shill_dictionary,
40 const OncValueSignature* onc_signature);
41
42 } // namespace onc
43 } // namespace chromeos
44
45 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_TRANSLATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698