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

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: 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') | ui/gfx/render_text.cc » ('J')
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..ede634540910692b122490c23d41bf78782a7d5b 100644
--- a/chrome/browser/ui/find_bar/find_tab_helper.cc
+++ b/chrome/browser/ui/find_bar/find_tab_helper.cc
@@ -40,6 +40,9 @@ FindTabHelper::~FindTabHelper() {
void FindTabHelper::StartFinding(base::string16 search_string,
bool forward_direction,
bool case_sensitive) {
+ const base::char16 kInvalidChars[] = { '\r', 0 };
+ base::RemoveChars(search_string, kInvalidChars, &search_string);
Peter Kasting 2014/07/09 00:27:05 You can just pass L"\r" here directly, no need to
msw 2014/07/09 00:40:12 Done.
Peter Kasting 2014/07/09 00:43:26 I'm thinking of pages that actually contain, say,
msw 2014/07/09 15:39:33 The patch works well in my tests of the following
+
// 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') | ui/gfx/render_text.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698