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

Side by Side Diff: chromeos/network/onc/onc_translator.h

Issue 552113002: Add ONC 'Source' configuration property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_279351_internet_options_9a
Patch Set: Rebase, Feedback, add *Policy sources 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 #ifndef CHROMEOS_NETWORK_ONC_ONC_TRANSLATOR_H_ 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_TRANSLATOR_H_
6 #define CHROMEOS_NETWORK_ONC_ONC_TRANSLATOR_H_ 6 #define CHROMEOS_NETWORK_ONC_ONC_TRANSLATOR_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chromeos/chromeos_export.h" 9 #include "chromeos/chromeos_export.h"
10 #include "components/onc/onc_constants.h"
10 11
11 namespace base { 12 namespace base {
12 class DictionaryValue; 13 class DictionaryValue;
13 } 14 }
14 15
15 namespace chromeos { 16 namespace chromeos {
16 namespace onc { 17 namespace onc {
17 18
18 struct OncValueSignature; 19 struct OncValueSignature;
19 20
20 // Translates a hierarchical ONC dictionary |onc_object| to a flat Shill 21 // Translates a hierarchical ONC dictionary |onc_object| to a flat Shill
21 // dictionary. The |signature| declares the type of |onc_object| and must point 22 // dictionary. The |signature| declares the type of |onc_object| and must point
22 // to one of the signature objects in "onc_signature.h". The resulting Shill 23 // to one of the signature objects in "onc_signature.h". The resulting Shill
23 // dictionary is returned. 24 // dictionary is returned.
24 // 25 //
25 // This function is used to translate network settings from ONC to Shill's 26 // This function is used to translate network settings from ONC to Shill's
26 // format before sending them to Shill. 27 // format before sending them to Shill.
27 CHROMEOS_EXPORT 28 CHROMEOS_EXPORT
28 scoped_ptr<base::DictionaryValue> TranslateONCObjectToShill( 29 scoped_ptr<base::DictionaryValue> TranslateONCObjectToShill(
29 const OncValueSignature* signature, 30 const OncValueSignature* signature,
30 const base::DictionaryValue& onc_object); 31 const base::DictionaryValue& onc_object);
31 32
32 // Translates a |shill_dictionary| to an ONC object according to the given 33 // Translates a |shill_dictionary| to an ONC object according to the given
33 // |onc_signature|. |onc_signature| must point to a signature object in 34 // |onc_signature|. |onc_signature| must point to a signature object in
34 // "onc_signature.h". The resulting ONC object is returned. 35 // "onc_signature.h". The resulting ONC object is returned.
35 // 36 //
36 // This function is used to translate network settings coming from Shill to ONC 37 // This function is used to translate network settings coming from Shill to ONC
37 // before sending them to the UI. The result doesn't have to be valid ONC, but 38 // before sending them to the UI. The result doesn't have to be valid ONC, but
38 // only a subset of it and includes only the values that are actually required 39 // only a subset of it and includes only the values that are actually required
39 // by the UI. 40 // by the UI. If |onc_source| specifies a Device or User policy then the
pneubeck (no reviews) 2014/09/10 10:49:38 As mentioned in the other comment, this leads to t
stevenjb 2014/09/10 17:32:15 Heh, I already jumped to '3' :)
41 // 'Source' property of the ONC dictionary will be set accordingly.
40 CHROMEOS_EXPORT 42 CHROMEOS_EXPORT
41 scoped_ptr<base::DictionaryValue> TranslateShillServiceToONCPart( 43 scoped_ptr<base::DictionaryValue> TranslateShillServiceToONCPart(
42 const base::DictionaryValue& shill_dictionary, 44 const base::DictionaryValue& shill_dictionary,
45 ::onc::ONCSource onc_source,
43 const OncValueSignature* onc_signature); 46 const OncValueSignature* onc_signature);
44 47
45 } // namespace onc 48 } // namespace onc
46 } // namespace chromeos 49 } // namespace chromeos
47 50
48 #endif // CHROMEOS_NETWORK_ONC_ONC_TRANSLATOR_H_ 51 #endif // CHROMEOS_NETWORK_ONC_ONC_TRANSLATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698