| 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 #include "chromeos/network/onc/onc_utils.h" | 5 #include "chromeos/network/onc/onc_utils.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 if (new_root.get() == NULL) { | 153 if (new_root.get() == NULL) { |
| 154 ONC_LOG_ERROR("Property dictionary malformed."); | 154 ONC_LOG_ERROR("Property dictionary malformed."); |
| 155 return scoped_ptr<base::DictionaryValue>(); | 155 return scoped_ptr<base::DictionaryValue>(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 return new_root.Pass(); | 158 return new_root.Pass(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 std::string GetSourceAsString(ONCSource source) { | 161 std::string GetSourceAsString(ONCSource source) { |
| 162 switch (source) { | 162 switch (source) { |
| 163 case ONC_SOURCE_UNKNOWN: |
| 164 return "unknown"; |
| 165 case ONC_SOURCE_NONE: |
| 166 return "none"; |
| 163 case ONC_SOURCE_DEVICE_POLICY: | 167 case ONC_SOURCE_DEVICE_POLICY: |
| 164 return "device policy"; | 168 return "device policy"; |
| 165 case ONC_SOURCE_USER_POLICY: | 169 case ONC_SOURCE_USER_POLICY: |
| 166 return "user policy"; | 170 return "user policy"; |
| 167 case ONC_SOURCE_NONE: | |
| 168 return "none"; | |
| 169 case ONC_SOURCE_USER_IMPORT: | 171 case ONC_SOURCE_USER_IMPORT: |
| 170 return "user import"; | 172 return "user import"; |
| 171 } | 173 } |
| 172 NOTREACHED() << "unknown ONC source " << source; | 174 NOTREACHED() << "unknown ONC source " << source; |
| 173 return "unknown"; | 175 return "unknown"; |
| 174 } | 176 } |
| 175 | 177 |
| 176 void ExpandField(const std::string& fieldname, | 178 void ExpandField(const std::string& fieldname, |
| 177 const StringSubstitution& substitution, | 179 const StringSubstitution& substitution, |
| 178 base::DictionaryValue* onc_object) { | 180 base::DictionaryValue* onc_object) { |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 } | 690 } |
| 689 | 691 |
| 690 const base::ListValue* recommended_keys = NULL; | 692 const base::ListValue* recommended_keys = NULL; |
| 691 return (onc->GetList(recommended_property_key, &recommended_keys) && | 693 return (onc->GetList(recommended_property_key, &recommended_keys) && |
| 692 recommended_keys->Find(base::StringValue(property_basename)) != | 694 recommended_keys->Find(base::StringValue(property_basename)) != |
| 693 recommended_keys->end()); | 695 recommended_keys->end()); |
| 694 } | 696 } |
| 695 | 697 |
| 696 } // namespace onc | 698 } // namespace onc |
| 697 } // namespace chromeos | 699 } // namespace chromeos |
| OLD | NEW |