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

Unified Diff: chrome/browser/ui/find_bar/find_tab_helper.cc

Issue 374253002: Strip carriage return from find text; show newline symbols. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore char16 arrays for cross platform support. Created 6 years, 5 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
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/find_bar/find_tab_helper.cc
diff --git a/chrome/browser/ui/find_bar/find_tab_helper.cc b/chrome/browser/ui/find_bar/find_tab_helper.cc
index 8a3570f750f53f303f90d39e83f7a1d2d391072a..0004febaefa85bd4c1f7ef6badc0b1c30fc03235 100644
--- a/chrome/browser/ui/find_bar/find_tab_helper.cc
+++ b/chrome/browser/ui/find_bar/find_tab_helper.cc
@@ -40,6 +40,10 @@ FindTabHelper::~FindTabHelper() {
void FindTabHelper::StartFinding(base::string16 search_string,
bool forward_direction,
bool case_sensitive) {
+ // Remove the carriage return character, which generally isn't in web content.
+ const base::char16 kInvalidChars[] = { '\r', 0 };
+ base::RemoveChars(search_string, kInvalidChars, &search_string);
+
// If search_string is empty, it means FindNext was pressed with a keyboard
// shortcut so unless we have something to search for we return early.
if (search_string.empty() && find_text_.empty()) {
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698