Commit a34ff62d authored by lazyboy's avatar lazyboy Committed by Commit bot

Update guest's InputMethodActive each time we see a TextInputTypeChanged.

BUG=450641
Test=<TO_BE_FILLED_IN>

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

Cr-Commit-Position: refs/heads/master@{#324002}
parent c73b6a46
......@@ -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;
SendTextInputTypeChangedToView(
static_cast<RenderWidgetHostViewBase*>(
web_contents()->GetRenderWidgetHostView())->TextInputTypeChanged(
type, input_mode, can_compose_inline, flags);
web_contents()->GetRenderWidgetHostView()));
}
void BrowserPluginGuest::OnImeCancelComposition() {
......
......@@ -63,6 +63,7 @@ class BrowserPluginGuestManager;
class RenderViewHostImpl;
class RenderWidgetHost;
class RenderWidgetHostView;
class RenderWidgetHostViewBase;
class SiteInstance;
struct DropData;
......@@ -341,6 +342,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost,
// Forwards all messages from the |pending_messages_| queue to the embedder.
void SendQueuedMessages();
void SendTextInputTypeChangedToView(RenderWidgetHostViewBase* guest_rwhv);
// The last tooltip that was set with SetTooltipText().
base::string16 current_tooltip_text_;
......
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