| Index: chrome/browser/autocomplete/autocomplete_match.cc
|
| ===================================================================
|
| --- chrome/browser/autocomplete/autocomplete_match.cc (revision 107565)
|
| +++ 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,21 @@
|
| }
|
| }
|
|
|
| +// static
|
| +string16 AutocompleteMatch::SanitizeString(const string16& text) {
|
| + // NOTE: This logic is mirrored by |sanitizeString()| in
|
| + // extension_process_bindings.js.
|
| + // 0x2028 = line separator; 0x2029 = paragraph separator.
|
| + const char16 kRemoveChars[] = { '\n', '\r', '\t',
|
| + 0x2028, // Line separator
|
| + 0x2029, // Paragraph separator
|
| + 0 };
|
| + string16 result;
|
| + TrimWhitespace(text, TRIM_LEADING, &result);
|
| + RemoveChars(result, kRemoveChars, &result);
|
| + return result;
|
| +}
|
| +
|
| #ifndef NDEBUG
|
| void AutocompleteMatch::Validate() const {
|
| ValidateClassifications(contents, contents_class);
|
|
|