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

Unified Diff: ui/gfx/render_text.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 | « chrome/browser/ui/find_bar/find_tab_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 4e7281c11695d4b7b70beb85b36e04227f425936..ddd854ba3478091fe53bdcb0de3d3a8f85cf3127 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -11,6 +11,7 @@
#include "base/i18n/break_iterator.h"
#include "base/logging.h"
#include "base/stl_util.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/icu/source/common/unicode/rbbi.h"
#include "third_party/icu/source/common/unicode/utf16.h"
@@ -1171,6 +1172,12 @@ void RenderText::UpdateLayoutText() {
layout_text_.assign(ElideText(layout_text_));
}
+ // Replace the newline character with a newline symbol in single line mode.
+ static const base::char16 kNewline[] = { '\n', 0 };
+ static const base::char16 kNewlineSymbol[] = { 0x2424, 0 };
+ if (!multiline_)
+ base::ReplaceChars(layout_text_, kNewline, kNewlineSymbol, &layout_text_);
+
ResetLayout();
}
« no previous file with comments | « chrome/browser/ui/find_bar/find_tab_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698