File: onc_merger.h

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (51 lines) | stat: -rw-r--r-- 2,305 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_ONC_ONC_MERGER_H_
#define CHROMEOS_ASH_COMPONENTS_NETWORK_ONC_ONC_MERGER_H_

#include "base/component_export.h"
#include "base/values.h"

namespace chromeos::onc {
struct OncValueSignature;
}

namespace ash::onc {

// Merges the given |user_settings| and |shared_settings| settings with the
// given |user_policy| and |device_policy| settings. Each can be omitted by
// providing nullptr. Each dictionary has to be part of a valid ONC dictionary.
// They don't have to describe top-level ONC but should refer to the same
// section in ONC. |user_settings| and |shared_settings| should not contain
// kRecommended fields. The resulting dictionary is valid ONC but may contain
// dispensable fields (e.g. in a network with type: "WiFi", the field "VPN" is
// dispensable) that can be removed by the caller using the ONC normalizer. ONC
// conformance of the arguments is not checked. Use ONC validator for that.
COMPONENT_EXPORT(CHROMEOS_NETWORK)
base::Value::Dict MergeSettingsAndPoliciesToEffective(
    const base::Value::Dict* user_policy,
    const base::Value::Dict* device_policy,
    const base::Value::Dict* user_settings,
    const base::Value::Dict* shared_settings);

// Like MergeSettingsWithPoliciesToEffective but creates one dictionary in place
// of each field that exists in any of the argument dictionaries. Each of these
// dictionaries contains the onc::kAugmentations* fields (see onc_constants.h)
// for which a value is available. The onc::kAugmentationEffectiveSetting field
// contains the field name of the field containing the effective field that
// overrides all other values. Credentials from policies are not written to the
// result.
COMPONENT_EXPORT(CHROMEOS_NETWORK)
base::Value::Dict MergeSettingsAndPoliciesToAugmented(
    const chromeos::onc::OncValueSignature& signature,
    const base::Value::Dict* user_policy,
    const base::Value::Dict* device_policy,
    const base::Value::Dict* user_settings,
    const base::Value::Dict* shared_settings,
    const base::Value::Dict* active_settings);

}  // namespace ash::onc

#endif  // CHROMEOS_ASH_COMPONENTS_NETWORK_ONC_ONC_MERGER_H_