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_validator.h" | 5 #include "chromeos/network/onc/onc_validator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace { | 21 namespace { |
22 | 22 |
23 std::string ValueToString(const base::Value& value) { | 23 std::string ValueToString(const base::Value& value) { |
24 std::string json; | 24 std::string json; |
25 base::JSONWriter::Write(&value, &json); | 25 base::JSONWriter::Write(&value, &json); |
26 return json; | 26 return json; |
27 } | 27 } |
28 | 28 |
29 // Copied from policy/configuration_policy_handler.cc. | 29 // Copied from policy/configuration_policy_handler.cc. |
30 // TODO(pneubeck): move to a common place like base/. | 30 // TODO(pneubeck): move to a common place like base/. |
31 std::string ValueTypeToString(Value::Type type) { | 31 std::string ValueTypeToString(base::Value::Type type) { |
32 static const char* strings[] = { | 32 static const char* strings[] = { |
33 "null", | 33 "null", |
34 "boolean", | 34 "boolean", |
35 "integer", | 35 "integer", |
36 "double", | 36 "double", |
37 "string", | 37 "string", |
38 "binary", | 38 "binary", |
39 "dictionary", | 39 "dictionary", |
40 "list" | 40 "list" |
41 }; | 41 }; |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 } | 777 } |
778 | 778 |
779 std::string Validator::MessageHeader() { | 779 std::string Validator::MessageHeader() { |
780 std::string path = path_.empty() ? "toplevel" : JoinString(path_, "."); | 780 std::string path = path_.empty() ? "toplevel" : JoinString(path_, "."); |
781 std::string message = "At " + path + ": "; | 781 std::string message = "At " + path + ": "; |
782 return message; | 782 return message; |
783 } | 783 } |
784 | 784 |
785 } // namespace onc | 785 } // namespace onc |
786 } // namespace chromeos | 786 } // namespace chromeos |
OLD | NEW |