Commit 8b0b5d0c authored by lazyboy's avatar lazyboy Committed by Commit bot

Fix OSX IME, Call RVH::SetInputMethodActive() after Attach.

This broke quite a bit ago when the implicit ordering changed by refactoring.
It is unfortunate that we don't have test coverage for mac, and
trying to type accent characters (IME) from browsertest didn't work.

BUG=450641
Test=On mac, load a chrome app with <webview> that has an input box.
Try to type accent chars, e.g. Option+e followed by e. Proper chars
should be seen in the input box.

Review URL: https://codereview.chromium.org/904013002

Cr-Commit-Position: refs/heads/master@{#315142}
parent 8cff53a6
...@@ -287,14 +287,6 @@ void BrowserPluginGuest::InitInternal( ...@@ -287,14 +287,6 @@ void BrowserPluginGuest::InitInternal(
GetWebContents()->GetRenderViewHost()->GetWebkitPreferences(); GetWebContents()->GetRenderViewHost()->GetWebkitPreferences();
prefs.navigate_on_drag_drop = false; prefs.navigate_on_drag_drop = false;
GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs); GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs);
// Enable input method for guest if it's enabled for the embedder.
if (static_cast<RenderViewHostImpl*>(
owner_web_contents_->GetRenderViewHost())->input_method_active()) {
RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
GetWebContents()->GetRenderViewHost());
guest_rvh->SetInputMethodActive(true);
}
} }
BrowserPluginGuest::~BrowserPluginGuest() { BrowserPluginGuest::~BrowserPluginGuest() {
...@@ -644,6 +636,14 @@ void BrowserPluginGuest::Attach( ...@@ -644,6 +636,14 @@ void BrowserPluginGuest::Attach(
has_render_view_ = true; has_render_view_ = true;
// Enable input method for guest if it's enabled for the embedder.
if (static_cast<RenderViewHostImpl*>(
owner_web_contents_->GetRenderViewHost())->input_method_active()) {
RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
GetWebContents()->GetRenderViewHost());
guest_rvh->SetInputMethodActive(true);
}
RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached"));
} }
......
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