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

Unified Diff: ui/gfx/render_text.h

Issue 1015533016: Move allow_character_break property to RenderText. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: line width for truncated words 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/render_text.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index 1b33b3c99ab207e2c31763931209015ba573bb8b..c375442d4e1b6e1fd15d906ea602e6b6be0c7fd0 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -256,11 +256,14 @@ class GFX_EXPORT RenderText {
// cleared when SetText or SetObscured is called.
void SetObscuredRevealIndex(int index);
- // TODO(ckocagil): Multiline text rendering is currently only supported on
- // Windows. Support other platforms.
+ // TODO(ckocagil): Multiline text rendering is not supported on Mac.
bool multiline() const { return multiline_; }
void SetMultiline(bool multiline);
+ // TODO(mukai): ELIDE_LONG_WORDS is not supported.
+ WordWrapBehavior word_wrap_behavior() const { return word_wrap_behavior_; }
+ void SetWordWrapBehavior(WordWrapBehavior behavior);
+
// Set whether newline characters should be replaced with newline symbols.
void SetReplaceNewlineCharsWithSymbols(bool replace);
@@ -634,6 +637,7 @@ class GFX_EXPORT RenderText {
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_NormalWidth);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_SufficientWidth);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_Newline);
+ FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_WordWrapBehavior);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, NewlineWithoutMultilineFlag);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GlyphBounds);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_GlyphBounds);
@@ -762,6 +766,10 @@ class GFX_EXPORT RenderText {
// |display_rect_| as the width cap.
bool multiline_;
+ // The wrap behavior when the text is broken into lines. Do nothing unless
+ // |multiline_| is set. The default value is IGNORE_LONG_WORDS.
+ WordWrapBehavior word_wrap_behavior_;
+
// Whether newline characters should be replaced with newline symbols.
bool replace_newline_chars_with_symbols_;
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698