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

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: fix 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/views/profiles/new_avatar_button.cc ('k') | ui/gfx/text_elider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/text_elider.h
diff --git a/ui/gfx/text_elider.h b/ui/gfx/text_elider.h
index a416fda779eb37e42ff32d2dbadb625ffcc62a3c..9d77afa04f01f2437d1ce579cf4a65331c00f71d 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,14 @@ 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
-// less.
+// 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 "...". 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
« no previous file with comments | « chrome/browser/ui/views/profiles/new_avatar_button.cc ('k') | ui/gfx/text_elider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698