Index: ui/base/text/text_elider.h |
diff --git a/ui/base/text/text_elider.h b/ui/base/text/text_elider.h |
index b2ec600c2016d2f3b300c7b8e2fac0311b0aad00..3c7d878b9d969b16e6c9bf9781c09a90ba622e0d 100644 |
--- a/ui/base/text/text_elider.h |
+++ b/ui/base/text/text_elider.h |
@@ -24,6 +24,22 @@ class GURL; |
namespace ui { |
UI_EXPORT extern const char kEllipsis[]; |
+UI_EXPORT extern const size_t kMaxProfileUsernameLength; |
+ |
+// Elides only the username portion of the |email|, if possible, so that the |
+// returned email is at most |max_email_length| characters (e.g. |
+// longusername@host.com --> longuser...@host.com for |max_email_length| == 20). |
+// If the domain name by itself already has more characters than available: |
+// it is elided in the middle so that only |max_email_length| / 2 characters |
+// remain; the username is then elided following the regular process described |
+// above. |
+// In any scenario: the string returned will never be longer than |
+// |max_email_length| including the inserted ellipses; and the elided strings |
+// will have at least one character remaining on either side of the '@'(other |
+// than the ellipsis-es). |
+// This function assumes |max_email_length| is >= 5. |
+UI_EXPORT string16 ElideEmail(const string16& email, |
+ size_t max_email_length); |
gab
2012/02/28 19:23:01
I moved this here as ElideEmail is above ElideUrl
|
// This function takes a GURL object and elides it. It returns a string |
// which composed of parts from subdomain, domain, path, filename and query. |