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

Unified Diff: ui/gfx/ios/NSString+CrStringDrawing.h

Issue 974913006: Upstream NSString+CrStringDrawing changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged with origin/master Created 5 years, 9 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/ios/NSString+CrStringDrawing.mm » ('j') | ui/gfx/ios/NSString+CrStringDrawing.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/ios/NSString+CrStringDrawing.h
diff --git a/ui/gfx/ios/NSString+CrStringDrawing.h b/ui/gfx/ios/NSString+CrStringDrawing.h
index 10916e9ee3dc675a97af449dd23cb99c6ffeb882..3c766ca09d6188ab1fbe6b059bcb55cf08bdda89 100644
--- a/ui/gfx/ios/NSString+CrStringDrawing.h
+++ b/ui/gfx/ios/NSString+CrStringDrawing.h
@@ -50,6 +50,16 @@
// sizeWithAttributes: (crbug.com/364419).
- (CGSize)cr_sizeWithFont:(UIFont*)font;
+// If |index| is 0, returns an empty string.
+// If |index| is >= than self.length, returns self.
+// Otherwise, returns string cut to have |index| characters with an
+// ellipsis at the end.
+- (NSString*)cr_stringByCuttingToIndex:(NSUInteger)index;
+
+// Returns an elided version of string that fits in |bounds|.
+// System font of Label size is used for determining the string drawing size.
+- (NSString*)cr_stringByElidingToFitSize:(CGSize)bounds;
+
@end
#endif // UI_GFX_IOS_NSSTRING_CR_STRING_DRAWING_H_
« no previous file with comments | « no previous file | ui/gfx/ios/NSString+CrStringDrawing.mm » ('j') | ui/gfx/ios/NSString+CrStringDrawing.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698