OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/common/json_schema_validator.h" | 5 #include "chrome/common/json_schema/json_schema_validator.h" |
6 | 6 |
7 #include <cfloat> | 7 #include <cfloat> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/common/json_schema_constants.h" | 13 #include "chrome/common/json_schema/json_schema_constants.h" |
14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
15 | 15 |
16 namespace schema = json_schema_constants; | 16 namespace schema = json_schema_constants; |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 double GetNumberValue(const Value* value) { | 20 double GetNumberValue(const Value* value) { |
21 double result = 0; | 21 double result = 0; |
22 CHECK(value->GetAsDouble(&result)) | 22 CHECK(value->GetAsDouble(&result)) |
23 << "Unexpected value type: " << value->GetType(); | 23 << "Unexpected value type: " << value->GetType(); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 487 |
488 if (*additional_properties_schema) { | 488 if (*additional_properties_schema) { |
489 std::string additional_properties_type(schema::kAny); | 489 std::string additional_properties_type(schema::kAny); |
490 CHECK((*additional_properties_schema)->GetString( | 490 CHECK((*additional_properties_schema)->GetString( |
491 schema::kType, &additional_properties_type)); | 491 schema::kType, &additional_properties_type)); |
492 return additional_properties_type == schema::kAny; | 492 return additional_properties_type == schema::kAny; |
493 } else { | 493 } else { |
494 return default_allow_additional_properties_; | 494 return default_allow_additional_properties_; |
495 } | 495 } |
496 } | 496 } |
OLD | NEW |