Add phone number to wallet addresses
[chromium-blink-merge.git] / chromeos / network / onc / onc_normalizer.h
blob2ee0935e4c4dea88df0ce90b6e18f90a142480c0
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.
5 #ifndef CHROMEOS_NETWORK_ONC_ONC_NORMALIZER_H_
6 #define CHROMEOS_NETWORK_ONC_ONC_NORMALIZER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chromeos/chromeos_export.h"
10 #include "chromeos/network/onc/onc_mapper.h"
12 namespace chromeos {
13 namespace onc {
15 struct OncValueSignature;
17 class CHROMEOS_EXPORT Normalizer : public Mapper {
18 public:
19 explicit Normalizer(bool remove_recommended_fields);
20 ~Normalizer() override;
22 // Removes all fields that are ignored/irrelevant because of the value of
23 // other fields. E.g. the "WiFi" field is irrelevant if the configurations
24 // type is "Ethernet". If |remove_recommended_fields| is true, kRecommended
25 // arrays are removed (the array itself and not the field names listed
26 // there). |object_signature| must point to one of the signatures in
27 // |onc_signature.h|. For configurations of type "WiFi", if the "SSID" field
28 // is set, but the field "HexSSID" is not, the contents of the "SSID" field is
29 // converted to UTF-8 encoding, a hex representation of the byte sequence is
30 // created and stored in the field "HexSSID".
31 scoped_ptr<base::DictionaryValue> NormalizeObject(
32 const OncValueSignature* object_signature,
33 const base::DictionaryValue& onc_object);
35 private:
36 // Dispatch to the right normalization function according to |signature|.
37 scoped_ptr<base::DictionaryValue> MapObject(
38 const OncValueSignature& signature,
39 const base::DictionaryValue& onc_object,
40 bool* error) override;
42 void NormalizeCertificate(base::DictionaryValue* cert);
43 void NormalizeEAP(base::DictionaryValue* eap);
44 void NormalizeEthernet(base::DictionaryValue* ethernet);
45 void NormalizeIPsec(base::DictionaryValue* ipsec);
46 void NormalizeNetworkConfiguration(base::DictionaryValue* network);
47 void NormalizeOpenVPN(base::DictionaryValue* openvpn);
48 void NormalizeProxySettings(base::DictionaryValue* proxy);
49 void NormalizeVPN(base::DictionaryValue* vpn);
50 void NormalizeWiFi(base::DictionaryValue* wifi);
52 const bool remove_recommended_fields_;
54 DISALLOW_COPY_AND_ASSIGN(Normalizer);
57 } // namespace onc
58 } // namespace chromeos
60 #endif // CHROMEOS_NETWORK_ONC_ONC_NORMALIZER_H_