Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: components/json_schema/json_schema_validator.cc

Issue 106553004: components: Remove 'ui' dependencies from json_schema and user_prefs targets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « components/json_schema.gypi ('k') | components/user_prefs.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/json_schema/json_schema_validator.h" 5 #include "components/json_schema/json_schema_validator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cfloat> 8 #include <cfloat>
9 #include <cmath> 9 #include <cmath>
10 10
11 #include "base/json/json_reader.h" 11 #include "base/json/json_reader.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "components/json_schema/json_schema_constants.h" 16 #include "components/json_schema/json_schema_constants.h"
17 #include "ui/base/l10n/l10n_util.h"
18 17
19 namespace schema = json_schema_constants; 18 namespace schema = json_schema_constants;
20 19
21 namespace { 20 namespace {
22 21
23 double GetNumberValue(const base::Value* value) { 22 double GetNumberValue(const base::Value* value) {
24 double result = 0; 23 double result = 0;
25 CHECK(value->GetAsDouble(&result)) 24 CHECK(value->GetAsDouble(&result))
26 << "Unexpected value type: " << value->GetType(); 25 << "Unexpected value type: " << value->GetType();
27 return result; 26 return result;
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 758
760 if (*additional_properties_schema) { 759 if (*additional_properties_schema) {
761 std::string additional_properties_type(schema::kAny); 760 std::string additional_properties_type(schema::kAny);
762 CHECK((*additional_properties_schema)->GetString( 761 CHECK((*additional_properties_schema)->GetString(
763 schema::kType, &additional_properties_type)); 762 schema::kType, &additional_properties_type));
764 return additional_properties_type == schema::kAny; 763 return additional_properties_type == schema::kAny;
765 } else { 764 } else {
766 return default_allow_additional_properties_; 765 return default_allow_additional_properties_;
767 } 766 }
768 } 767 }
OLDNEW
« no previous file with comments | « components/json_schema.gypi ('k') | components/user_prefs.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698