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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 1031533002: Supports the invisible underline for native input fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revised per comments and fixed test failures. 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
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 717d94837c80caa571760d69a1e743d4ee7e595f..b8d78f19d8ba43dfc60fe7f08caefe6ae9f24257 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1485,13 +1485,14 @@ bool Textfield::GetCompositionCharacterBounds(uint32 index,
DCHECK(rect);
if (!HasCompositionText())
return false;
- gfx::RenderText* render_text = GetRenderText();
- const gfx::Range& composition_range = render_text->GetCompositionRange();
+ gfx::Range composition_range;
+ model_->GetCompositionTextRange(&composition_range);
DCHECK(!composition_range.is_empty());
size_t text_index = composition_range.start() + index;
if (composition_range.end() <= text_index)
return false;
+ gfx::RenderText* render_text = GetRenderText();
if (!render_text->IsValidCursorIndex(text_index)) {
text_index = render_text->IndexOfAdjacentGrapheme(
text_index, gfx::CURSOR_BACKWARD);

Powered by Google App Engine
This is Rietveld 408576698