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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 1052343003: Update guest's InputMethodActive each time we see a TextInputTypeChanged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@imactive-fix
Patch Set: Address comments Created 5 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
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698