OLD | NEW |
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 <ostream> | 5 #include <ostream> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 !it_default_key_values.IsAtEnd(); it_default_key_values.Advance()) { | 153 !it_default_key_values.IsAtEnd(); it_default_key_values.Advance()) { |
154 const base::Value* actual_value; | 154 const base::Value* actual_value; |
155 if (form_json.Get(it_default_key_values.key(), &actual_value) && | 155 if (form_json.Get(it_default_key_values.key(), &actual_value) && |
156 it_default_key_values.value().Equals(actual_value)) { | 156 it_default_key_values.value().Equals(actual_value)) { |
157 form_json.Remove(it_default_key_values.key(), nullptr); | 157 form_json.Remove(it_default_key_values.key(), nullptr); |
158 } | 158 } |
159 } | 159 } |
160 | 160 |
161 std::string form_as_string; | 161 std::string form_as_string; |
162 base::JSONWriter::WriteWithOptions( | 162 base::JSONWriter::WriteWithOptions( |
163 &form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); | 163 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); |
164 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); | 164 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); |
165 return os << "PasswordForm(" << form_as_string << ")"; | 165 return os << "PasswordForm(" << form_as_string << ")"; |
166 } | 166 } |
167 | 167 |
168 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { | 168 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { |
169 return os << "&" << *form; | 169 return os << "&" << *form; |
170 } | 170 } |
171 | 171 |
172 } // namespace autofill | 172 } // namespace autofill |
OLD | NEW |