Index: ui/gfx/render_text.cc |
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc |
index d849c88b0df21de7a1b0442a74fe62815a38e0cc..69c7c0b1b9bbdc73bec61ca6c7d77f8bd177645c 100644 |
--- a/ui/gfx/render_text.cc |
+++ b/ui/gfx/render_text.cc |
@@ -1031,9 +1031,10 @@ Vector2d RenderText::GetLineOffset(size_t line_number) { |
return offset; |
} |
-bool RenderText::GetDecoratedWordAtPoint(const Point& point, |
- DecoratedText* decorated_word, |
- Point* baseline_point) { |
+bool RenderText::GetDecoratedWordAndBaselineAtPoint( |
+ const Point& point, |
+ DecoratedText* decorated_word, |
+ Point* baseline_point) { |
if (obscured()) |
return false; |
@@ -1048,9 +1049,19 @@ bool RenderText::GetDecoratedWordAtPoint(const Point& point, |
DCHECK(!word_range.is_reversed()); |
DCHECK(!word_range.is_empty()); |
+ return GetDecoratedTextAndBaselineForRange(word_range, decorated_word, |
+ baseline_point); |
+} |
+ |
+bool RenderText::GetDecoratedTextAndBaselineForRange( |
+ const Range& word_range, |
+ DecoratedText* decorated_text, |
+ Point* baseline_point) { |
+ EnsureLayout(); |
+ |
const std::vector<Rect> word_bounds = GetSubstringBounds(word_range); |
if (word_bounds.empty() || |
- !GetDecoratedTextForRange(word_range, decorated_word)) { |
+ !GetDecoratedTextForRange(word_range, decorated_text)) { |
return false; |
} |