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

Unified Diff: ui/gfx/text_elider.h

Issue 103493003: Revert of Implement eliding/truncating at end in RenderText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 eef1f8e6a9f61e5549147516a72ca1237ac63086..4eaca828c7dd84780b625907e97ff44067d4aa89 100644
--- a/ui/gfx/text_elider.h
+++ b/ui/gfx/text_elider.h
@@ -28,38 +28,6 @@
GFX_EXPORT extern const char kEllipsis[];
GFX_EXPORT extern const base::char16 kEllipsisUTF16[];
-
-
-// Helper class to split + elide text, while respecting UTF16 surrogate pairs.
-class StringSlicer {
- public:
- StringSlicer(const base::string16& text,
- const base::string16& ellipsis,
- bool elide_in_middle);
-
- // Cuts |text_| to be |length| characters long. If |elide_in_middle_| is true,
- // the middle of the string is removed to leave equal-length pieces from the
- // beginning and end of the string; otherwise, the end of the string is
- // removed and only the beginning remains. If |insert_ellipsis| is true,
- // then an ellipsis character will be inserted at the cut point.
- base::string16 CutString(size_t length, bool insert_ellipsis);
-
- private:
- // Returns a valid cut boundary at or before/after |index|.
- size_t FindValidBoundaryBefore(size_t index) const;
- size_t FindValidBoundaryAfter(size_t index) const;
-
- // The text to be sliced.
- const base::string16& text_;
-
- // Ellipsis string to use.
- const base::string16& ellipsis_;
-
- // If true, the middle of the string will be elided.
- bool elide_in_middle_;
-
- DISALLOW_COPY_AND_ASSIGN(StringSlicer);
-};
// Elides a well-formed email address (e.g. username@domain.com) to fit into
// |available_pixel_width| using the specified |font_list|.
@@ -100,9 +68,7 @@
// Add ellipsis in the middle of the string.
ELIDE_IN_MIDDLE,
// Truncate the end of the string.
- TRUNCATE_AT_END,
- // No eliding of the string.
- NO_ELIDE
+ TRUNCATE_AT_END
};
// Elides |text| to fit in |available_pixel_width| according to the specified

Powered by Google App Engine
This is Rietveld 408576698