Commit f035886c authored by ekaramad's avatar ekaramad Committed by Commit bot

Fix an IME regression for <webview> due to missing IPC message param

The IPC message BrowserPluginHostMsg_ImeFinishComposingText does not have a
parameter for the instance ID of BrowserPlugin and therefore, is dropped on
the browser side inside BrowserPluginMessageFilter. This causes a regression
in (Japanese) IME where clicking during an ongoing composition does not commit.

BUG=720023

Review-Url: https://codereview.chromium.org/2887973002
Cr-Commit-Position: refs/heads/master@{#473976}
parent 29ef1208
......@@ -920,7 +920,10 @@ void BrowserPluginGuest::OnImeCommitText(
replacement_range, relative_cursor_pos));
}
void BrowserPluginGuest::OnImeFinishComposingText(bool keep_selection) {
void BrowserPluginGuest::OnImeFinishComposingText(
int browser_plugin_instance_id,
bool keep_selection) {
DCHECK_EQ(browser_plugin_instance_id_, browser_plugin_instance_id);
Send(new InputMsg_ImeFinishComposingText(routing_id(), keep_selection));
}
......
......@@ -343,7 +343,7 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost,
const std::vector<blink::WebCompositionUnderline>& underlines,
const gfx::Range& replacement_range,
int relative_cursor_pos);
void OnImeFinishComposingText(bool keep_selection);
void OnImeFinishComposingText(int instance_id, bool keep_selection);
void OnExtendSelectionAndDelete(int instance_id, int before, int after);
void OnImeCancelComposition();
#if defined(OS_MACOSX) || defined(USE_AURA)
......
......@@ -58,7 +58,10 @@ IPC_STRUCT_END()
// These messages are from the embedder to the browser process.
// Most messages from the embedder to the browser process are CONTROL because
// they are routed to the appropriate BrowserPluginGuest based on the
// browser_plugin_instance_id which is unique per embedder process.
// |browser_plugin_instance_id| which is unique per embedder process.
// |browser_plugin_instance_id| is only used by BrowserPluginMessageFilter to
// find the right BrowserPluginGuest. It should not be needed by the final IPC
// handler.
// This message is sent from BrowserPlugin to BrowserPluginGuest to issue an
// edit command.
......@@ -89,7 +92,8 @@ IPC_MESSAGE_CONTROL5(
// This message is sent from BrowserPlugin to BrowserPluginGuest to notify that
// inserting the current composition is requested.
IPC_MESSAGE_CONTROL1(BrowserPluginHostMsg_ImeFinishComposingText,
IPC_MESSAGE_CONTROL2(BrowserPluginHostMsg_ImeFinishComposingText,
int /* browser_plugin_instance_id */,
bool /* keep selection */)
// Deletes the current selection plus the specified number of characters before
......
......@@ -604,7 +604,8 @@ bool BrowserPlugin::FinishComposingText(
bool keep_selection =
(selection_behavior == blink::WebInputMethodController::kKeepSelection);
BrowserPluginManager::Get()->Send(
new BrowserPluginHostMsg_ImeFinishComposingText(keep_selection));
new BrowserPluginHostMsg_ImeFinishComposingText(
browser_plugin_instance_id_, keep_selection));
// TODO(kochi): This assumes the IPC handling always succeeds.
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment