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

Unified Diff: ui/gfx/render_text.h

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedbacks Created 7 years, 2 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
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index df23ff3ef88b431135716432a117ea9b4a07b835..6888084d18a0eb9a92e23aa05b98bb6a723f297f 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -25,6 +25,7 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/selection_model.h"
#include "ui/gfx/shadow_value.h"
+#include "ui/gfx/size_f.h"
#include "ui/gfx/text_constants.h"
#include "ui/gfx/vector2d.h"
@@ -326,6 +327,12 @@ class GFX_EXPORT RenderText {
// shadows.
virtual Size GetStringSize() = 0;
+ // This is same as GetStringSize except that fractional size is returned.
+ // The default implementation is same as GetStringSize. Certain platforms that
+ // compute the text size as floating-point values, like Mac, will override
+ // this method.
+ virtual SizeF GetStringSizeF();
+
// 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();

Powered by Google App Engine
This is Rietveld 408576698