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

Unified Diff: chrome/browser/autocomplete/autocomplete_match.cc

Issue 8364001: Strip special characters in extension omnibox suggestions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months 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 side-by-side diff with in-line comments
Download patch
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& text) {
+ const char16 kRemoveChars[] = { '\n', '\r', '\t', 0x2028, 0x2029, 0 };
+ string16 result;
+ TrimWhitespace(text, TRIM_ALL, &result);
+ RemoveChars(result, kRemoveChars, &result);
+ return result;
+}
+
#ifndef NDEBUG
void AutocompleteMatch::Validate() const {
ValidateClassifications(contents, contents_class);

Powered by Google App Engine
This is Rietveld 408576698