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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1889053003: Fix InputConnection.deleteSurroundingText() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Same to patch set 13, except adding a test for multiple nodes. Created 4 years, 6 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index c73b789cb8f00d00a90ce6b3407b47fca487437e..2499723cbf0fbd3ea2d11bd5eaf6f7ee0e2bd82b 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1501,6 +1501,7 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling)
IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete,
OnExtendSelectionAndDelete)
+ IPC_MESSAGE_HANDLER(InputMsg_DeleteSurroundingText, OnDeleteSurroundingText)
IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText,
OnSetCompositionFromExistingText)
IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets,
@@ -2074,6 +2075,14 @@ void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) {
frame_->extendSelectionAndDelete(before, after);
}
+void RenderFrameImpl::OnDeleteSurroundingText(int before, int after) {
+ if (!GetRenderWidget()->ShouldHandleImeEvent())
+ return;
+
+ ImeEventGuard guard(GetRenderWidget());
+ frame_->deleteSurroundingText(before, after);
+}
+
void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) {
if (accessibility_mode_ == new_mode)
return;

Powered by Google App Engine
This is Rietveld 408576698