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

Unified Diff: ui/gfx/text_elider.h

Issue 381953002: New avatar button: Consolidate text elision between Mac and Win/Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use gfx::BreakType 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
Index: ui/gfx/text_elider.h
diff --git a/ui/gfx/text_elider.h b/ui/gfx/text_elider.h
index a416fda779eb37e42ff32d2dbadb625ffcc62a3c..44543bb3d0ffd3e8a97f55136ca15d1c6f9a9b05 100644
--- a/ui/gfx/text_elider.h
+++ b/ui/gfx/text_elider.h
@@ -143,7 +143,7 @@ enum ReformattingResultFlags {
// too long are broken into pieces. For words that are too wide to fit on a
// single line, the wrapping behavior can be specified with the |wrap_behavior|
// param. Returns a combination of |ReformattingResultFlags| that indicate
-// whether the given rectangle had insufficient space to accommodate |texŧ|,
+// whether the given rectangle had insufficient space to accommodate |text|,
// leading to elision or truncation (and not just reformatting).
GFX_EXPORT int ElideRectangleText(const base::string16& text,
const gfx::FontList& font_list,
@@ -152,13 +152,15 @@ GFX_EXPORT int ElideRectangleText(const base::string16& text,
WordWrapBehavior wrap_behavior,
std::vector<base::string16>* lines);
-// Truncates the string to length characters. This breaks the string at
-// the first word break before length, adding the horizontal ellipsis
-// character (unicode character 0x2026) to render ...
-// The supplied string is returned if the string has length characters or
+// Truncates |string| to |length| characters. This breaks the string according
+// to the specified |break_type|, which must be either WORD_BREAK or
+// CHARACTER_BREAK, and adds the horizontal ellipsis character (unicode
+// character 0x2026) to render ...
msw 2014/07/21 15:26:07 nit: put ... in quotation marks and start the next
Marc Treib 2014/07/21 16:43:52 Done.
+// The supplied string is returned if the string has |length| characters or
// less.
GFX_EXPORT base::string16 TruncateString(const base::string16& string,
- size_t length);
+ size_t length,
+ BreakType break_type);
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698