Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_VALIDATOR_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
| 6 #define CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 6 #define CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 bool FieldExistsAndIsNotInRange(const base::DictionaryValue& object, | 208 bool FieldExistsAndIsNotInRange(const base::DictionaryValue& object, |
| 209 const std::string &field_name, | 209 const std::string &field_name, |
| 210 int lower_bound, | 210 int lower_bound, |
| 211 int upper_bound); | 211 int upper_bound); |
| 212 | 212 |
| 213 bool FieldExistsAndIsEmpty(const base::DictionaryValue& object, | 213 bool FieldExistsAndIsEmpty(const base::DictionaryValue& object, |
| 214 const std::string& field_name); | 214 const std::string& field_name); |
| 215 | 215 |
| 216 bool RequireField(const base::DictionaryValue& dict, const std::string& key); | 216 bool RequireField(const base::DictionaryValue& dict, const std::string& key); |
| 217 | 217 |
| 218 // Prohibit certificate patterns for device policy ONC so that an unmanaged | |
| 219 // user won't have a certificate presented for them involuntarily. | |
| 218 bool CertPatternInDevicePolicy(const std::string& cert_type); | 220 bool CertPatternInDevicePolicy(const std::string& cert_type); |
| 219 | 221 |
| 222 // Prohibit global network configuration in user ONC imports. | |
| 223 bool GlobalNetworkConfigInUserImport(const base::DictionaryValue& onc_object); | |
|
bartfab (slow)
2013/10/16 12:40:31
Nit: Could these methods that return a bool be pre
pneubeck (no reviews)
2013/10/17 10:22:26
Done.
| |
| 224 | |
| 220 std::string MessageHeader(); | 225 std::string MessageHeader(); |
| 221 | 226 |
| 222 const bool error_on_unknown_field_; | 227 const bool error_on_unknown_field_; |
| 223 const bool error_on_wrong_recommended_; | 228 const bool error_on_wrong_recommended_; |
| 224 const bool error_on_missing_field_; | 229 const bool error_on_missing_field_; |
| 225 const bool managed_onc_; | 230 const bool managed_onc_; |
| 226 | 231 |
| 227 ::onc::ONCSource onc_source_; | 232 ::onc::ONCSource onc_source_; |
| 228 | 233 |
| 229 // The path of field names and indices to the current value. Indices | 234 // The path of field names and indices to the current value. Indices |
| 230 // are stored as strings in decimal notation. | 235 // are stored as strings in decimal notation. |
| 231 std::vector<std::string> path_; | 236 std::vector<std::string> path_; |
| 232 | 237 |
| 233 // Tracks if an error or warning occurred within validation initiated by | 238 // Tracks if an error or warning occurred within validation initiated by |
| 234 // function ValidateAndRepairObject. | 239 // function ValidateAndRepairObject. |
| 235 bool error_or_warning_found_; | 240 bool error_or_warning_found_; |
| 236 | 241 |
| 237 DISALLOW_COPY_AND_ASSIGN(Validator); | 242 DISALLOW_COPY_AND_ASSIGN(Validator); |
| 238 }; | 243 }; |
| 239 | 244 |
| 240 } // namespace onc | 245 } // namespace onc |
| 241 } // namespace chromeos | 246 } // namespace chromeos |
| 242 | 247 |
| 243 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 248 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
| OLD | NEW |