Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_match.cc |
| =================================================================== |
| --- chrome/browser/autocomplete/autocomplete_match.cc (revision 107110) |
| +++ chrome/browser/autocomplete/autocomplete_match.cc (working copy) |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "base/logging.h" |
| +#include "base/string_util.h" |
| #include "chrome/browser/autocomplete/autocomplete_match.h" |
| #include "grit/theme_resources.h" |
| @@ -156,6 +157,15 @@ |
| } |
| } |
| +// static |
| +string16 AutocompleteMatch::SanitizeString(const string16& contents) { |
| + const char16 kRemoveChars[] = { '\n', '\r', '\t', 0 }; |
|
Peter Kasting
2011/10/25 20:37:07
Nit: From looking at string_util.cc it seems like
Alexei Svitkine (slow)
2011/10/25 21:37:16
Done.
|
| + string16 result; |
| + TrimString(contents, kWhitespaceUTF16, &result); |
|
Peter Kasting
2011/10/25 20:37:07
Nit: Use TrimWhitespace(contents, TRIM_ALL, &resul
Alexei Svitkine (slow)
2011/10/25 21:37:16
Done.
|
| + RemoveChars(result, kRemoveChars, &result); |
| + return result; |
| +} |
| + |
| #ifndef NDEBUG |
| void AutocompleteMatch::Validate() const { |
| ValidateClassifications(contents, contents_class); |