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..8d8a57c08c93e73e13af53230ebdcc112c90ac05 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) { |
Fady Samuel
2015/04/06 20:05:03
nit: Early exist preferred.
lazyboy
2015/04/07 00:42:26
Done.
|
+ 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()) { |
Fady Samuel
2015/04/06 20:05:03
nit: indentation. Also, let's early exit here too.
lazyboy
2015/04/07 00:42:26
Done.
|
+ 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() { |