Index: ui/gfx/render_text.h |
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h |
index 6258c8bd22d4a5a37d0efb94ad9f411353f07f6d..afd62eae6b972a587deb4ad5e74767b65967aa89 100644 |
--- a/ui/gfx/render_text.h |
+++ b/ui/gfx/render_text.h |
@@ -29,7 +29,6 @@ |
#include "ui/gfx/shadow_value.h" |
#include "ui/gfx/size_f.h" |
#include "ui/gfx/text_constants.h" |
-#include "ui/gfx/text_elider.h" |
#include "ui/gfx/vector2d.h" |
class SkCanvas; |
@@ -254,11 +253,12 @@ class GFX_EXPORT RenderText { |
// WARNING: Only use this for system limits, it lacks complex text support. |
void set_truncate_length(size_t length) { truncate_length_ = length; } |
- // Elides the text to fit in |display_rect| according to the specified |
- // |elide_behavior|. |ELIDE_MIDDLE| is not supported. If a truncate length and |
- // an elide mode are specified, the shorter of the two will be applicable. |
+ // The layout text will be elided to fit |display_rect| using this behavior. |
+ // The layout text may be shortened further by the truncate length. |
void SetElideBehavior(ElideBehavior elide_behavior); |
+ const base::string16& layout_text() const { return layout_text_; } |
+ |
const Rect& display_rect() const { return display_rect_; } |
void SetDisplayRect(const Rect& r); |
@@ -355,7 +355,7 @@ class GFX_EXPORT RenderText { |
// Returns the width of the content (which is the wrapped width in multiline |
// mode). Reserves room for the cursor if |cursor_enabled_| is true. |
- int GetContentWidth(); |
+ float GetContentWidth(); |
// Returns the common baseline of the text. The return value is the vertical |
// offset from the top of |display_rect_| to the text baseline, in pixels. |
@@ -581,9 +581,13 @@ class GFX_EXPORT RenderText { |
// Updates |layout_text_| if the text is obscured or truncated. |
void UpdateLayoutText(); |
- // Elides |text| to fit in the |display_rect_| with given |elide_behavior_|. |
- // See ElideText in ui/gfx/text_elider.cc for reference. |
- base::string16 ElideText(const base::string16& text); |
+ // Elides |text| as needed to fit in the |available_width| using |behavior|. |
+ base::string16 Elide(const base::string16& text, |
+ float available_width, |
+ ElideBehavior behavior); |
+ |
+ // Elides |email| as needed to fit the |available_width|. |
+ base::string16 ElideEmail(const base::string16& email, float available_width); |
// Update the cached bounds and display offset to ensure that the current |
// cursor is within the visible display area. |