| OLD | NEW |
| (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_NORMALIZER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_NORMALIZER_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/chromeos/network_settings/onc_mapper.h" |
| 10 |
| 11 namespace chromeos { |
| 12 namespace onc { |
| 13 |
| 14 class OncValueSignature; |
| 15 |
| 16 class Normalizer : public Mapper { |
| 17 public: |
| 18 explicit Normalizer(bool remove_recommended_fields); |
| 19 |
| 20 // Removes all fields that are ignored/irrelevant because of the value of |
| 21 // other fields. E.g. the "WiFi" field is irrelevant if the configurations |
| 22 // type is "Ethernet". If |remove_recommended_fields| is true, kRecommended |
| 23 // arrays are removed (the array itself and not the fieldnames listed |
| 24 // there). |object_signature| must point to one of the signatures in |
| 25 // |onc_signature.h|. |
| 26 scoped_ptr<base::DictionaryValue> NormalizeObject( |
| 27 const OncValueSignature* object_signature, |
| 28 const base::DictionaryValue& onc_object); |
| 29 |
| 30 private: |
| 31 // Dispatch to the right normalization function according to |signature|. |
| 32 virtual scoped_ptr<base::DictionaryValue> MapObject( |
| 33 const OncValueSignature& signature, |
| 34 const base::DictionaryValue& onc_object); |
| 35 |
| 36 void NormalizeIPsec(base::DictionaryValue* ipsec); |
| 37 void NormalizeVPN(base::DictionaryValue* vpn); |
| 38 void NormalizeNetworkConfiguration(base::DictionaryValue* network); |
| 39 |
| 40 const bool remove_recommended_fields_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(Normalizer); |
| 43 }; |
| 44 |
| 45 } // namespace onc |
| 46 } // namespace chromeos |
| 47 |
| 48 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_NORMALIZER_H_ |
| OLD | NEW |