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

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

Issue 2696883002: Fix a recent regression in IME inside OOPIFs (Merge to M-57) (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
« no previous file with comments | « content/public/test/text_input_test_utils.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5405d908bcd7fcd11b05bb5b709eeb518e85b46b 100644
--- a/content/public/test/text_input_test_utils.cc
+++ b/content/public/test/text_input_test_utils.cc
@@ -71,7 +71,7 @@ class TextInputManagerTester::InternalObserver
on_text_selection_changed_callback_ = callback;
}
- const RenderWidgetHostView* GetUpdatedView() const { return updated_view_; }
+ RenderWidgetHostView* GetUpdatedView() const { return updated_view_; }
bool text_input_state_changed() const { return text_input_state_changed_; }
@@ -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.emplace_back(
+ 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 =
@@ -325,7 +342,7 @@ const RenderWidgetHostView* TextInputManagerTester::GetActiveView() {
return observer_->text_input_manager()->active_view_for_testing();
}
-const RenderWidgetHostView* TextInputManagerTester::GetUpdatedView() {
+RenderWidgetHostView* TextInputManagerTester::GetUpdatedView() {
return observer_->GetUpdatedView();
}
« no previous file with comments | « content/public/test/text_input_test_utils.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698