Chromium Code Reviews| Index: content/public/test/text_input_test_utils.cc |
| diff --git a/content/public/test/text_input_test_utils.cc b/content/public/test/text_input_test_utils.cc |
| index e37b5dc435f2efd81adc2b6ef6a70cd8e71945d0..a24333c788478cd2847c3c097964181acead3b96 100644 |
| --- a/content/public/test/text_input_test_utils.cc |
| +++ b/content/public/test/text_input_test_utils.cc |
| @@ -262,6 +262,23 @@ bool DoesFrameHaveFocusedEditableElement(RenderFrameHost* frame) { |
| ->has_focused_editable_element(); |
| } |
| +void SendImeCommitTextToWidget( |
| + RenderWidgetHost* rwh, |
| + const base::string16& text, |
| + const std::vector<ui::CompositionUnderline>& underlines, |
| + const gfx::Range& replacement_range, |
| + int relative_cursor_pos) { |
| + std::vector<blink::WebCompositionUnderline> web_composition_underlines; |
| + for (auto underline : underlines) { |
| + web_composition_underlines.push_back(blink::WebCompositionUnderline( |
|
alexmos
2017/02/08 02:16:23
optional: emplace_back would let you avoid explici
EhsanK
2017/02/09 00:50:34
Sorry I just saw this suggestion. Thanks (And Done
|
| + static_cast<int>(underline.start_offset), |
| + static_cast<int>(underline.end_offset), underline.color, |
| + underline.thick, underline.background_color)); |
| + } |
| + RenderWidgetHostImpl::From(rwh)->ImeCommitText( |
| + text, web_composition_underlines, replacement_range, relative_cursor_pos); |
| +} |
| + |
| size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) { |
| std::unordered_set<RenderWidgetHostView*> views; |
| TextInputManager* manager = |