Index: content/browser/browser_plugin/browser_plugin_guest.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc |
index fd53a0c31a5cd16d81fd1f9a7f1e6e7f22cd68a6..5fde66c951d3927a7f2612a621ded15c162d794a 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -179,10 +179,7 @@ void BrowserPluginGuest::SetFocus(RenderWidgetHost* rwh, |
// Restore the last seen state of text input to the view. |
RenderWidgetHostViewBase* rwhv = static_cast<RenderWidgetHostViewBase*>( |
rwh->GetView()); |
- if (rwhv) { |
- rwhv->TextInputTypeChanged(last_text_input_type_, last_input_mode_, |
- last_can_compose_inline_, last_input_flags_); |
- } |
+ SendTextInputTypeChangedToView(rwhv); |
} |
void BrowserPluginGuest::SetTooltipText(const base::string16& tooltip_text) { |
@@ -494,6 +491,23 @@ void BrowserPluginGuest::SendQueuedMessages() { |
} |
} |
+void BrowserPluginGuest::SendTextInputTypeChangedToView( |
+ RenderWidgetHostViewBase* guest_rwhv) { |
+ if (!guest_rwhv) |
+ return; |
+ |
+ guest_rwhv->TextInputTypeChanged(last_text_input_type_, last_input_mode_, |
+ last_can_compose_inline_, last_input_flags_); |
+ // Enable input method for guest if it's enabled for the embedder. |
+ if (!static_cast<RenderViewHostImpl*>( |
+ owner_web_contents_->GetRenderViewHost())->input_method_active()) { |
+ return; |
+ } |
+ RenderViewHostImpl* guest_rvh = |
+ static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()); |
+ guest_rvh->SetInputMethodActive(true); |
+} |
+ |
void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( |
RenderFrameHost* render_frame_host, |
const GURL& url, |
@@ -888,9 +902,9 @@ void BrowserPluginGuest::OnTextInputTypeChanged(ui::TextInputType type, |
last_input_flags_ = flags; |
last_can_compose_inline_ = can_compose_inline; |
- static_cast<RenderWidgetHostViewBase*>( |
- web_contents()->GetRenderWidgetHostView())->TextInputTypeChanged( |
- type, input_mode, can_compose_inline, flags); |
+ SendTextInputTypeChangedToView( |
+ static_cast<RenderWidgetHostViewBase*>( |
+ web_contents()->GetRenderWidgetHostView())); |
} |
void BrowserPluginGuest::OnImeCancelComposition() { |