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

Unified Diff: content/public/test/text_input_test_utils.cc

Issue 2681473002: Fix a recent regression in IME inside OOPIFs (Closed)
Patch Set: Created 3 years, 10 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: 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 =

Powered by Google App Engine
This is Rietveld 408576698