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

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. 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 | « ui/gfx/render_text.cc ('k') | ui/views/controls/textfield/textfield_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 6ca37f960c9cba3cbe5bbbeb6e7bc75e4b21bf71..6320d37938f4da7c0238ff67603e842e62bffc49 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1490,13 +1490,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);
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/views/controls/textfield/textfield_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698