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

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: handle multi-code text with BackspaceStateMachine::previousPositionOf Created 4 years, 8 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 fecee3060bd411b412092beacdd47a318f315e84..a3a9b0676abd43423fdc6f912cd4312ac322ca9b 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1404,6 +1404,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_ExecuteNoValueEditCommand,
@@ -1965,6 +1966,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